DrawingAttributes.MinWidth Alan
Tanım
public: static initonly double MinWidth;
public static readonly double MinWidth;
staticval mutable MinWidth : double
Public Shared ReadOnly MinWidth As Double
Alan Değeri
Örnekler
Aşağıdaki örnek Width , öğesinin özelliğinin DrawingAttributes geçerli bir değer olarak ayarlanmış olmasını sağlar.The following example ensures the Width property of the DrawingAttributes is set to a legal value. Bu örnek, aranan olduğunu varsayar InkCanvas inkCanvas1
.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
Açıklamalar
MinWidthBir değerin özellik için izin verilen limitlerin içinde olup olmadığını denetlemek için alanını kullanın Width .Use the MinWidth field to check whether a value is within the limits allowed for the Width property. Değer, kısıtlanmış olmayan kullanıcı girişi gibi bilinmeyen bir kaynaktan geliyorsa bunu yapın.Do this when the value comes from an unknown source, such as unconstrained user input.