方法: BetweenShowDelay プロパティを使用する

この例では、BetweenShowDelay の時間プロパティを使用して、ユーザーがマウス ポインターをあるツールヒントから別のツールヒントに直接移動したときにそのツールヒントをすばやく (遅延なし、またはほとんどなく) 表示させる方法を示します。

次の例では、InitialShowDelay プロパティが 1 秒 (1,000 ミリ秒) に設定され、BetweenShowDelay は両方の Ellipse コントロールのツールヒントで 2 秒 (2,000 ミリ秒) に設定されています。 いずれかの省略記号のツールヒントを表示し、2 秒以内にマウス ポインターを別の省略記号に移動して一時停止すると、2 番目の省略記号のツールヒントがすぐに表示されます。

次のいずれのシナリオでも、InitialShowDelay が適用され、2 番目の省略記号のツールヒントが 1 秒間待機してから表示されます。

  • 2 番目のボタンへの移動にかかる時間が 2 秒を超えている場合。

  • 最初の省略記号の時間間隔の開始時にツールヒントが表示されない場合。

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

関連項目