Uredi

Deli z drugimi prek


DrawingAttributes.MaxHeight Field

Definition

Specifies the largest value allowed for the Height property.

public: static initonly double MaxHeight;
public static readonly double MaxHeight;
 staticval mutable MaxHeight : double
Public Shared ReadOnly MaxHeight 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 MaxHeight 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