开发者

initialise backgroundWoker in code

TextBox tb = Form1.thisForm.Controls["textbox1"] as TextBox;

how come i cant do the same with a backgroundWorker control?

开发者_JS百科backgroundWorker wk = Form1.thisForm.Controls["backgroundWorker1"] as backgroundWorker;


Because BackgroundWorker is not Control and doesn't belong to Controls collection.

Windows Form designer generates C# code which creates backgroundWorker1 instance. You can use it directly. But this instance is not added (and cannot be added) to the Form Controls property.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜