c# - Create an user-control from another thread -
i wish create button ( made me user-control ) thread other 1 wish create on . thing know how modify user-control object thread ( using delegate , .invokerequired ) don't know how create 1 . suggestions ?
try following:
// other thread usercontrol11.begininvoke(new action(() => { var button = new button(); button.text = "my new button"; usercontrol11.controls.add(button); }));
within delegate (the () => { }
), can user control , form.
Comments
Post a Comment