Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个连接到表的 datagridview。当执行某些操作时,datagridview 会发生变化,但我希望它刷新(即从我创建的数据表中重新加载网格),即使用户没有做任何事情,所以用户看到的数据是最新的。做这个的最好方式是什么?谢谢!
尝试使用这样的计时器
private void Form1_Load(object sender, EventArgs e) { Timer timer = new Timer(); timer.Interval=1000; // time in milliseconds timer.Tick+=new EventHandler(timer_Tick); } void timer_Tick(object sender, EventArgs e) { //Do your update here }