ToolTip.Placement ToolTip.Placement ToolTip.Placement ToolTip.Placement Property

定義

ToolTip コントロールが開いたときの向きを取得または設定し、ToolTip コントロールが画面の境界と重複するときの動作を指定します。Gets or sets the orientation of the ToolTip control when it opens, and specifies how the ToolTip control behaves when it overlaps screen boundaries.

public:
 property System::Windows::Controls::Primitives::PlacementMode Placement { System::Windows::Controls::Primitives::PlacementMode get(); void set(System::Windows::Controls::Primitives::PlacementMode value); };
[System.ComponentModel.Bindable(true)]
public System.Windows.Controls.Primitives.PlacementMode Placement { get; set; }
member this.Placement : System.Windows.Controls.Primitives.PlacementMode with get, set
Public Property Placement As PlacementMode

プロパティ値

PlacementMode コントロールが開いた場合の向きを決定し、このコントロールの画面の境界に対する動作を指定する ToolTip 列挙値。A PlacementMode enumeration value that determines the orientation of the ToolTip control when it opens, and that specifies how the control interacts with screen boundaries. 既定値は、Mouse です。The default is Mouse.

ToolTip作成して配置する方法を次の例に示します。The following example shows how to create and position a ToolTip.

<Ellipse Height="25" Width="50" 
         Fill="Gray" 
         HorizontalAlignment="Left"
         ToolTipService.InitialShowDelay="1000"
         ToolTipService.ShowDuration="7000"
         ToolTipService.BetweenShowDelay="2000">
  <Ellipse.ToolTip>
    <ToolTip Placement="Right" 
             PlacementRectangle="50,0,0,0"
             HorizontalOffset="10" 
             VerticalOffset="20"
             HasDropShadow="false"
             Opened="whenToolTipOpens"
             Closed="whenToolTipCloses"
             >
      <BulletDecorator>
        <BulletDecorator.Bullet>
          <Ellipse Height="10" Width="20" Fill="Blue"/>
        </BulletDecorator.Bullet>
        <TextBlock>Uses the ToolTip Class</TextBlock>
      </BulletDecorator>
    </ToolTip>
  </Ellipse.ToolTip>
</Ellipse>

//Create an ellipse that will have a 
//ToolTip control. 
Ellipse ellipse1 = new Ellipse();
ellipse1.Height = 25;
ellipse1.Width = 50;
ellipse1.Fill = Brushes.Gray;
ellipse1.HorizontalAlignment = HorizontalAlignment.Left;

//Create a tooltip and set its position.
ToolTip tooltip = new ToolTip();
tooltip.Placement = PlacementMode.Right;
tooltip.PlacementRectangle = new Rect(50, 0, 0, 0);
tooltip.HorizontalOffset = 10;
tooltip.VerticalOffset = 20;

//Create BulletDecorator and set it
//as the tooltip content.
BulletDecorator bdec = new BulletDecorator();
Ellipse littleEllipse = new Ellipse();
littleEllipse.Height = 10;
littleEllipse.Width = 20;
littleEllipse.Fill = Brushes.Blue;
bdec.Bullet = littleEllipse;
TextBlock tipText = new TextBlock();
tipText.Text = "Uses the ToolTip class";
bdec.Child = tipText;
tooltip.Content = bdec;

//set tooltip on ellipse
ellipse1.ToolTip = tooltip;
'Create an ellipse that will have a 
'ToolTip control. 
Dim ellipse1 As New Ellipse()
ellipse1.Height = 25
ellipse1.Width = 50
ellipse1.Fill = Brushes.Gray
ellipse1.HorizontalAlignment = HorizontalAlignment.Left

'Create a tooltip and set its position.
Dim tooltip As New ToolTip()
tooltip.Placement = PlacementMode.Right
tooltip.PlacementRectangle = New Rect(50, 0, 0, 0)
tooltip.HorizontalOffset = 10
tooltip.VerticalOffset = 20

'Create BulletDecorator and set it
'as the tooltip content.
Dim bdec As New BulletDecorator()
Dim littleEllipse As New Ellipse()
littleEllipse.Height = 10
littleEllipse.Width = 20
littleEllipse.Fill = Brushes.Blue
bdec.Bullet = littleEllipse
Dim tipText As New TextBlock()
tipText.Text = "Uses the ToolTip class"
bdec.Child = tipText
tooltip.Content = bdec

'set tooltip on ellipse
ellipse1.ToolTip = tooltip

注釈

ToolTip配置VerticalOffsetPropertyするにPlacementTargetは、 PlacementRectangle、、 HorizontalOffset、、およびの各プロパティを設定します。 PlacementYou can position a ToolTip by setting the PlacementTarget, PlacementRectangle, Placement, HorizontalOffset, and VerticalOffsetProperty properties. これらのプロパティは、 Popupの場合と同じように動作します。These properties behave the same as they do for a Popup. 詳細については、「Popup Placement Behavior」を参照してください。For more information, see Popup Placement Behavior.

依存プロパティ情報Dependency Property Information

識別子フィールドIdentifier field PlacementProperty
メタデータプロパティがに設定されるtrueMetadata properties set to true NoneNone

適用対象

こちらもご覧ください