winform 页面刷新有关问题
winform 页面刷新问题!C# codeInstall install new Install()install.MaximizeBox falseinstall.Sho
winform 页面刷新问题!
C# codeInstall install = new Install(); install.MaximizeBox = false; install.ShowDialog(); ocnn = new OleDbConnection(connections); ocnn.Open(); OleDbCommand command = new OleDbCommand("select * from MIS_Install where ID=1", ocnn); OleDbDataReader dr = command.ExecuteReader(); dr.Read(); InstallValue = dr["Install_Value"].ToString(); ocnn.Close(); this.Refresh();
在Install 子窗体中改变 表MIS_Install 对应的值,第一次改完后确定 主窗体的内容能刷新成功,也是我想要的效果。但是第二次更改后就不自己刷新了,还要我手动去点下别内容的才刷新。这是为什么?
[解决办法]用委托去刷新,很简单
http://www.cnblogs.com/devil733/archive/2009/08/13/1545182.html
[解决办法]this.Refresh();不能刷新数据,你需要重新绑定数据源才会刷新,
[解决办法]这样试试
this.Refresh();
Application.DoEvents();//处理当前所有的WINDOWS的所有消息