共用方式為


HOW TO:使用 BetweenShowDelay 屬性

更新:2010 年 7 月

此範例說明如何使用 BetweenShowDelay 時間屬性,在使用者將滑鼠指標從一個工具提示直接移至另一個工具提示時,讓工具提示能快速顯示 (只有一點點或完全沒有延遲)。

範例

在下列範例中,兩個 Ellipse 控制項之工具提示的 InitialShowDelay 屬性設定為一秒 (1000 毫秒),BetweenShowDelay 則設定為兩秒 (2000 毫秒)。 如果您顯示其中一個橢圓形的工具提示,然後在兩秒之內將滑鼠指標移至另一個橢圓形並停在這裡,就會立即顯示第二個橢圓形的工具提示。

下列任一情形都會套用 InitialShowDelay,也就是第二個橢圓形的工具提示會等待一秒再顯示:

  • 移至第二個按鈕所花的時間超過兩秒。

  • 第一個橢圓形時間間隔一開始時看不到工具提示。

      <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>



...


<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>

請參閱

參考

ToolTip

ToolTipService

概念

工具提示概觀

其他資源

ToolTip HOW TO 主題

變更記錄

日期

記錄

原因

2010 年 7 月

加入遺漏的程式碼。

客戶回函。