DrawingAttributes.MinWidth 欄位
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
指定 Width 屬性允許的最小值。
public: static initonly double MinWidth;
public static readonly double MinWidth;
staticval mutable MinWidth : double
Public Shared ReadOnly MinWidth As Double
欄位值
範例
下列範例可確保 Width 的 DrawingAttributes 屬性設定為合法值。 此範例假設有 InkCanvas 名為 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
備註
使用 MinWidth 欄位來檢查值是否在屬性允許 Width 的限制內。 當值來自未知的來源時,請執行此動作,例如未受限制的使用者輸入。
適用於
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應