开发者

WinForms - Will there normally only be one instance of MainForm?

开发者 https://www.devze.com 2022-12-25 11:49 出处:网络
Will there normally only be one instance of MainForm? I need to hold it as a static variable re this issu开发者_StackOverflow社区e I haveYes, there would normally only be a single instance, unless yo

Will there normally only be one instance of MainForm?

I need to hold it as a static variable re this issu开发者_StackOverflow社区e I have


Yes, there would normally only be a single instance, unless you specifically create more instances of it in your application code.


Even if you have multiple instances of MainForm, if you declare a variable in the form as static (and not ThreadStatic), there will only be one copy of that variable.

0

精彩评论

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

关注公众号