开发者

Throwing errors while changing Ui design

I have a Datagrid , 2 textBoxes and 4 buttons whenever I change positions or add a new controls , It gives errors form my grid variable saying it is not in current context . I am creating a window Applica开发者_高级运维tion and using WinForms. I dont use any threads to Design


It sounds like you may be running into a pretty common issue. ..

The designer will execute any code found in the constructor and, if IIRC, the Load event.

Simple way to do this without rearranging all your code to guard any code that isn't purely (and I mean purely) layout code with a check to the form or control's DesignMode property...

if(!DesignMode)
{
//your code
}


As Scoregraphic asks are you performing this manipulation within a separate thread?

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜