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

更新 : 2010 年 7 月

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

使用例

次の例では、両方の Ellipse コントロールのツールヒントについて、InitialShowDelay プロパティを 1 秒 (1000 ミリ秒) に設定し、BetweenShowDelay を 2 秒 (2000 ミリ秒) に設定しています。 一方の楕円のツールヒントを表示した後、2 秒以内に別の楕円にマウス ポインターを移動してそこにとどまると、2 番目の楕円のツールヒントがすぐに表示されます。

次のシナリオではいずれも、InitialShowDelay が適用され、2 番目の楕円のツールヒントは 1 秒後に表示されます。

  • 2 番目の楕円に移動するのに 2 秒より長くかかる場合。

  • 1 番目の楕円の時間間隔の開始時に、ツールヒントが表示されない場合。

      <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 の概要

その他の技術情報

ToolTip に関する「方法」トピック

履歴の変更

日付

履歴

理由

2010 年 7 月

コードを補足。

カスタマー フィードバック