共用方式為


ToolTipService.GetPlacement(DependencyObject) 方法

定義

取得物件之 Placement 附加屬性的值。

public:
 static System::Windows::Controls::Primitives::PlacementMode GetPlacement(System::Windows::DependencyObject ^ element);
[System.Windows.AttachedPropertyBrowsableForType(typeof(System.Windows.DependencyObject))]
public static System.Windows.Controls.Primitives.PlacementMode GetPlacement (System.Windows.DependencyObject element);
[<System.Windows.AttachedPropertyBrowsableForType(typeof(System.Windows.DependencyObject))>]
static member GetPlacement : System.Windows.DependencyObject -> System.Windows.Controls.Primitives.PlacementMode
Public Shared Function GetPlacement (element As DependencyObject) As PlacementMode

參數

element
DependencyObject

要讀取屬性值的物件。

傳回

物件的 Placement 屬性值。

屬性

範例

下列範例示範如何取得附加屬性的值 ToolTipService.Placement 。 方法 FindName 會尋找名為 ellipse2 的物件,也就是 Ellipse

PlacementMode myMode = ToolTipService.GetPlacement(
 (DependencyObject)FindName("ellipse2"));
Dim myMode As PlacementMode = ToolTipService.GetPlacement(CType(FindName("ellipse2"), DependencyObject))

適用於

另請參閱