简体   繁体   中英

Refreshing a windows form application

我有两个Windows窗体应用程序。在第一个应用程序中,我有一个名为“请求”的按钮。如果我按下“请求”按钮,则同一应用程序中datagriview中的数据应转到数据库并在另一个应用程序中显示通知我已经成功做到了。我所需要的就是让第二个Windows窗体应用程序每5分钟刷新一次。该怎么做?

我不清楚您的问题是什么,但是如果我做对了(您想在第二个应用程序中引用一个表单,该表单将通知您有关数据更新的信息),然后将计时器控件放在表单上的某个位置(您要引用的表单) ),并将其持续时间设置为5秒后,您可以在表单的tick事件中编写刷新逻辑。

You can do these works to set an autorefresh for every 5min but I didn't understand your question!

  1. Add a timer
  2. Change the interval to 300000
  3. Double click on Form and write:

timer1.Start(); //Replace your timer name instead of "timer1"

  1. Double click on Timer and write:

    this.Refresh();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM