ControlDesigner.AllowResize 属性

定义

获取一个值,该值指示是否可以在设计时环境中调整控件的大小。

public:
 virtual property bool AllowResize { bool get(); };
public virtual bool AllowResize { get; }
member this.AllowResize : bool
Public Overridable ReadOnly Property AllowResize As Boolean

属性值

Boolean

如果控件的大小可以调整,则为 true;否则为 false

示例

下面的代码示例演示如何重写 AllowResize 自定义控件设计器类中的属性。

此代码示例是为属性提供的大型示例的 TemplateGroups 一部分。

// Do not allow direct resizing unless in TemplateMode
public override bool AllowResize
{
    get
    {
        if (this.InTemplateMode)
            return true;
        else
            return false;
    }
}
' Do not allow direct resizing unless in TemplateMode
Public Overrides ReadOnly Property AllowResize() As Boolean
    Get
        If Me.InTemplateMode Then
            Return True
        Else
            Return False
        End If
    End Get
End Property

继承者说明

AllowResize使用派生类中的属性启用或禁用页面开发人员在设计主机中调整控件的大小。

适用于

另请参阅