designmode总是假的 [英] designmode is always false
问题描述
我有一个用户控件,我已经在源的不同部分测试了DesigMode的值,但是从来没有得到真正的值,而且总是假的。
I读到它设置为true的第一个位置是加载事件,然后我创建了以下事件但仍然是假的。
this.Load + = new System .EventHandler(this.ReportDesigner_Load);
private void ReportDesigner_Load(Object sender,EventArgs e)
{
IsRunningByDeveloper = this.DesignMode;
}
我不知道出了什么问题,我还检查了所有的其他解决方案网站,但没有一个工作。
我也使用许可证管理器如下,但仍处于运行时模式。
I have a user control and I have tested the value of DesigMode in different parts of source, but never get the true value and is always false.
I read that the first place that it is set to true is in load event, then I created the following event but still get false.
this.Load += new System.EventHandler(this.ReportDesigner_Load);
private void ReportDesigner_Load(Object sender, EventArgs e)
{
IsRunningByDeveloper = this.DesignMode;
}
I don't know what is wrong , I have also checked other solutions in all the sites but none of them worked .
I also used license manager as below but still in runtime mode.
if (System.ComponentModel.LicenseManager.UsageMode == LicenseUsageMode.Designtime)
IsRunningByDeveloper = true;
任何建议都将受到赞赏
Any suggestions would be appreciated
推荐答案
DesignMode
属性指示控件是否在Visual Studio的设计模式下呈现
什么是Control的DesignMode属性以及如何使用它? [ ^ ]
TheDesignMode
property indicates whether the control is rendering in the design mode of Visual Studio
What is Control's DesignMode property and how to use it?[^]
这篇关于designmode总是假的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!