DrawingAttributes.MinWidth Field
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Specifies the smallest value allowed for the Width property.
public: static initonly double MinWidth;
public static readonly double MinWidth;
staticval mutable MinWidth : double
Public Shared ReadOnly MinWidth As Double
Field Value
Examples
The following example ensures the Width property of the DrawingAttributes is set to a legal value. This example assumes that there is an InkCanvas called inkCanvas1
.
if (DAWidth < DrawingAttributes.MinWidth)
{
DAWidth = DrawingAttributes.MinWidth;
}
else if (DAWidth > DrawingAttributes.MaxWidth)
{
DAWidth = DrawingAttributes.MaxWidth;
}
inkCanvas1.DefaultDrawingAttributes.Width = DAWidth;
If DAWidth < DrawingAttributes.MinWidth Then
DAWidth = DrawingAttributes.MinWidth
ElseIf DAWidth > DrawingAttributes.MaxWidth Then
DAWidth = DrawingAttributes.MaxWidth
End If
inkCanvas1.DefaultDrawingAttributes.Width = DAWidth
Remarks
Use the MinWidth field to check whether a value is within the limits allowed for the Width property. Do this when the value comes from an unknown source, such as unconstrained user input.
Applies to
Feedback
https://aka.ms/ContentUserFeedback.
Kommer snart: I hele 2024 udfaser vi GitHub-problemer som feedbackmekanisme for indhold og erstatter det med et nyt feedbacksystem. Du kan få flere oplysninger under:Indsend og få vist feedback om