后续自 this question , 是否可以从对象的构造函数中检测是处于设计模式还是运行时模式?
我意识到这可能是不可能的,我必须改变我想要的,但现在我对这个具体问题很感兴趣。
最佳答案
您可以使用 LicenceUsageMode System.ComponentModel
命名空间中的枚举:
bool designMode = (LicenseManager.UsageMode == LicenseUsageMode.Designtime);
关于c# - 从控件的构造函数中检测设计模式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39913164/