Control.DesignMode 属性

定义

获取一个值,该值指示是否正在使用设计图面上的一个控件。Gets a value indicating whether a control is being used on a design surface.

protected public:
 property bool DesignMode { bool get(); };
protected internal bool DesignMode { get; }
member this.DesignMode : bool
Protected Friend ReadOnly Property DesignMode As Boolean

属性值

如果设计器中正在使用控件,则为 true;否则为 falsetrue if the control is being used in a designer; otherwise, false.

注解

DesignMode 属性返回 true,指示设计器的上下文中正在使用该控件。The DesignMode property returns true to indicate that the control is being used in the context of a designer. 当设计时行为不同于运行时行为时,您的自定义控件可以使用此属性。Your custom controls can use this property when design-time behavior is different than run-time behavior.

适用于

另请参阅