Editare

Partajați prin


DrawingAttributes.MinHeight Field

Definition

Specifies the smallest value allowed for the Height property.

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

Field Value

Examples

The following example ensures the Height property of the DrawingAttributes is set to a legal value. This example assumes that there is an InkCanvas called 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

Remarks

Use the MinHeight field to check whether a value is within the limits allowed for the Height property. Do this when the value comes from an unknown source, such as unconstrained user input.

Applies to