gpt4 book ai didi

c# - 在运行程序中等待一秒钟

转载 作者:IT王子 更新时间:2023-10-29 03:39:24 27 4
gpt4 key购买 nike

dataGridView1.Rows[x1].Cells[y1].Style.BackColor = System.Drawing.Color.Red;
System.Threading.Thread.Sleep(1000);

© 想要在使用此代码打印我的网格单元之前等待一秒钟,但它不起作用。我能做什么?

最佳答案

是否正在暂停,但您没有看到红色出现在单元格中?试试这个:

dataGridView1.Rows[x1].Cells[y1].Style.BackColor = System.Drawing.Color.Red;
dataGridView1.Refresh();
System.Threading.Thread.Sleep(1000);

关于c# - 在运行程序中等待一秒钟,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10458118/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com