public void SetStatusBarPanelTextValue(System.Windows.Forms.StatusBar p_oStatusBar, int p_intStatusBarPanelIndex, string p_strValue) { if (p_oStatusBar.InvokeRequired) { SetStatusBarPanelTextValueCallback d = new SetStatusBarPanelTextValueCallback(this.SetStatusBarPanelTextValue); p_oStatusBar.Invoke(d, new object[] { p_oStatusBar, p_intStatusBarPanelIndex, p_strValue }); } else { p_oStatusBar.Panels[p_intStatusBarPanelIndex].Text = p_strValue; } }
public void SetStatusBarText(string s) { if (!statusBar1.InvokeRequired) { statusBar1.Text = s; } else //We are on a non GUI thread. { SetStatusBarTextDelegate ssbtDel = new SetStatusBarTextDelegate(SetStatusBarText); statusBar1.Invoke(ssbtDel, new object[] { s }); } }
public void ExecuteStatusBarPanelMethod(System.Windows.Forms.StatusBar p_oStatusBar, int p_intStatusBarPanelIndex, string p_strMethodName) { if (p_oStatusBar.InvokeRequired) { ExecuteStatusBarPanelMethodCallback d = new ExecuteStatusBarPanelMethodCallback(ExecuteStatusBarPanelMethod); p_oStatusBar.Invoke(d, new object[] { p_oStatusBar, p_intStatusBarPanelIndex, p_strMethodName }); } else { Type t = p_oStatusBar.Panels[p_intStatusBarPanelIndex].GetType(); System.Reflection.MethodInfo[] methods = t.GetMethods(); foreach (System.Reflection.MethodInfo m in methods) { if (m.Name.Trim().ToUpper() == p_strMethodName.Trim().ToUpper()) { m.Invoke(p_oStatusBar.Panels[p_intStatusBarPanelIndex], null); return; } } } }