Created
April 29, 2011 10:38
-
-
Save santhotech/948162 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
delegate void SetCtrlCallback(string val, property p, Control ctrl); | |
private void SetCtrl(string value, property p, Control ctrl) | |
{ | |
if (ctrl.InvokeRequired) | |
{ | |
SetCtrlCallbackd = new SetCtrlCallback(SetCtrl); | |
this.Invoke(d, new object[] { val,p,ctrl }); | |
} | |
else | |
{ | |
ctrl.p= val; | |
} | |
} | |
so that i can call from with in another thread | |
SetCtrl("mytext",Text,Button1) | |
SetCtrl("mytext",Text,Button2) | |
SetCtrl(color.green,BackColor,Button1) | |
SetCtrl(color.green,ForeColor,Button1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment