DrawingAttributes.MinHeight Veld

Definitie

Hiermee geeft u de kleinste waarde op die is toegestaan voor de Height eigenschap.

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

Waarde van veld

Voorbeelden

In het volgende voorbeeld wordt ervoor gezorgd dat de Height eigenschap van de DrawingAttributes eigenschap is ingesteld op een juridische waarde. In dit voorbeeld wordt ervan uitgegaan dat er een InkCanvas aangeroepen inkCanvas1naam is.

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

Opmerkingen

Gebruik het MinHeight veld om te controleren of een waarde binnen de limieten valt die zijn toegestaan voor de Height eigenschap. Doe dit wanneer de waarde afkomstig is van een onbekende bron, zoals niet-getrainde gebruikersinvoer.

Van toepassing op