ToolTipService.ShowDuration 附加屬性

定義

取得或設定工具提示保持可見的時間量。

see GetShowDuration, and SetShowDuration
see GetShowDuration, and SetShowDuration
see GetShowDuration, and SetShowDuration

例外狀況

InitialShowDelay 屬性的值小於零 (0)。

範例

下列範例示範如何設定 ShowDuration 工具提示的屬性。

<Ellipse Height="25" Width="50" 
      Fill="Gray" 
      HorizontalAlignment="Left"
      ToolTipService.InitialShowDelay="1000"
      ToolTipService.ShowDuration="7000"
      ToolTipService.BetweenShowDelay="2000"
      ToolTipService.Placement="Right" 
      ToolTipService.PlacementRectangle="50,0,0,0"
      ToolTipService.HorizontalOffset="10" 
      ToolTipService.VerticalOffset="20"
      ToolTipService.HasDropShadow="false"
      ToolTipService.ShowOnDisabled="true" 
      ToolTipService.IsEnabled="true"
      ToolTipOpening="whenToolTipOpens"
      ToolTipClosing="whenToolTipCloses"
      >
  <Ellipse.ToolTip>
    <BulletDecorator>
      <BulletDecorator.Bullet>
        <Ellipse Height="10" Width="20" Fill="Blue"/>
      </BulletDecorator.Bullet>
      <TextBlock>Uses the ToolTipService class</TextBlock>
    </BulletDecorator>
  </Ellipse.ToolTip>
</Ellipse>
ToolTipService.SetShowDuration(ellipse1, 7000);
ToolTipService.SetShowDuration(ellipse1, 7000)

備註

這個屬性會定義工具提示在使用者將滑鼠指標暫停至定義工具提示的物件上時,保持可見的時間。 如果使用者將滑鼠指標移離物件,工具提示就會關閉。

這個屬性是附加屬性。 如需如何在程式碼中取得或設定此屬性值的相關資訊,請參閱 GetShowDurationSetShowDuration 方法。

相依性屬性資訊

識別碼欄位 ShowDurationProperty
設定為 的中繼資料屬性 true

適用於

另請參閱