DrawingAttributes.MinHeight 字段
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
指定属性允许的 Height 最小值。
public: static initonly double MinHeight;
public static readonly double MinHeight;
staticval mutable MinHeight : double
Public Shared ReadOnly MinHeight As Double
字段值
示例
以下示例确保该HeightDrawingAttributes属性设置为法定值。 此示例假定有一个 InkCanvas 调用 inkCanvas1。
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 的限制范围内。 当值来自未知源(例如不受约束的用户输入)时执行此操作。