How to update UI when invoke method failed
set visible = true then message box show it is false
delegate void LoadLastDeptSettingDelegate(String last_dept);
private void LoadLastDeptSetting(String last_dept)
{
//MessageBox.Show("last dept " + last_dept + this.InvokeRequired.ToString());
if (this.InvokeRequired)
{
//this.BeginInvoke(new MethodInvoker(delegate() { LoadLastDeptSetting(last_dept); }));
this.Invoke(new LoadLastDeptSettingDelegate(this.LoadLastDeptSetting), new
object[] { last_dept });
}
开发者_C百科else
{
grpPeriod.Visible = true;
MessageBox.Show("before 3 " + this.grpPeriod.Visible.ToString());
The Visible
property indicates the control's actual visibility.
If one of the control's ancestors, or the entire form, is not visible, it will always return false
.
精彩评论