delegate string GetTextCallback(ComboBox cb); private string GetText(ComboBox cb) { if (cb.InvokeRequired) { GetTextCallback stc = new GetTextCallback(GetText); return this.Invoke(stc, new object[] { cb }).ToString (); } else { return cb.Text; } }
設定控制項文字
delegate void SetTextCallback(string text); private void SetText(string text) { if (txtbMeasureState.InvokeRequired) { SetTextCallback stc = new SetTextCallback(SetText); this.Invoke(stc, new object[] { text }); } else { txtbMeasureState.Text = text; } }
沒有留言:
張貼留言