DrawingAttributes.MinHeight 字段

定义

指定 Height 属性所允许的最小值。

public: static initonly double MinHeight;
public static readonly double MinHeight;
 staticval mutable MinHeight : double
Public Shared ReadOnly MinHeight As Double 

字段值

示例

以下示例确保 的 HeightDrawingAttributes 属性设置为合法值。 此示例假定有一个名为 InkCanvasinkCanvas1

if (DAHeight < DrawingAttributes.MinHeight)
{
    DAHeight = DrawingAttributes.MinHeight;
}
else if (DAHeight > DrawingAttributes.MaxHeight)
{
    DAHeight = DrawingAttributes.MaxHeight;
}

inkCanvas1.DefaultDrawingAttributes.Height = DAHeight;
If DAHeight < DrawingAttributes.MinHeight Then

    DAHeight = DrawingAttributes.MinHeight

ElseIf DAHeight > DrawingAttributes.MaxHeight Then

    DAHeight = DrawingAttributes.MaxHeight

End If

inkCanvas1.DefaultDrawingAttributes.Height = DAHeight

注解

MinHeight使用 字段检查值是否在属性允许Height的限制内。 当值来自未知源(例如不受约束的用户输入)时执行此操作。

适用于