AdornerPanel.SetAdornerHorizontalAlignment 方法
針對指定的項目,設定 AdornerHorizontalAlignment 附加屬性。
命名空間: Microsoft.Windows.Design.Interaction
組件: Microsoft.Windows.Design.Interaction (在 Microsoft.Windows.Design.Interaction.dll 中)
語法
'宣告
Public Shared Sub SetAdornerHorizontalAlignment ( _
obj As DependencyObject, _
value As AdornerHorizontalAlignment _
)
public static void SetAdornerHorizontalAlignment(
DependencyObject obj,
AdornerHorizontalAlignment value
)
public:
static void SetAdornerHorizontalAlignment(
DependencyObject^ obj,
AdornerHorizontalAlignment value
)
static member SetAdornerHorizontalAlignment :
obj:DependencyObject *
value:AdornerHorizontalAlignment -> unit
public static function SetAdornerHorizontalAlignment(
obj : DependencyObject,
value : AdornerHorizontalAlignment
)
參數
- obj
型別:System.Windows.DependencyObject
寫入附加屬性的項目。
- value
型別:Microsoft.Windows.Design.Interaction.AdornerHorizontalAlignment
要設定為 AdornerPanel 的 AdornerHorizontalAlignment。
範例
在下列程式碼範例中,會說明如何使用 SetAdornerHorizontalAlignment 方法,指定裝飾項的水平對齊。 如需詳細資訊,請參閱逐步解說:建立設計階段裝飾項。
' The slider extends the full width of the control it adorns.
AdornerPanel.SetAdornerHorizontalAlignment( _
opacitySlider, _
AdornerHorizontalAlignment.Stretch)
' Position the adorner above the control it adorns.
AdornerPanel.SetAdornerVerticalAlignment( _
opacitySlider, _
AdornerVerticalAlignment.OutsideTop)
' Position the adorner 5 pixels above the control.
AdornerPanel.SetAdornerMargin( _
opacitySlider, _
New Thickness(0, 0, 0, 5))
// The slider extends the full width of the control it adorns.
AdornerPanel.SetAdornerHorizontalAlignment(
opacitySlider,
AdornerHorizontalAlignment.Stretch);
// Position the adorner above the control it adorns.
AdornerPanel.SetAdornerVerticalAlignment(
opacitySlider,
AdornerVerticalAlignment.OutsideTop);
// Position the adorner 5 pixels above the control.
AdornerPanel.SetAdornerMargin(
opacitySlider,
new Thickness(0, 0, 0, 5));
.NET Framework 安全性
- 完全信任立即呼叫者。這個成員無法供部分信任的程式碼使用。如需詳細資訊,請參閱從部分受信任程式碼使用程式庫。
請參閱
參考
Microsoft.Windows.Design.Interaction 命名空間