次の方法で共有


ToolTip.AutoPopDelay プロパティ

ツール ヒント テキストが指定されたコントロール内でマウス ポインタが静止している場合に、ツール ヒントが表示される時間を取得または設定します。

Public Property AutoPopDelay As Integer
[C#]
public int AutoPopDelay {get; set;}
[C++]
public: __property int get_AutoPopDelay();public: __property void set_AutoPopDelay(int);
[JScript]
public function get AutoPopDelay() : int;public function set AutoPopDelay(int);

プロパティ値

コントロール内でマウス ポインタが静止している場合に、 ToolTip が表示される時間 (ミリ秒単位)。既定値は、5000 です。

解説

このプロパティを使用すると、マウス ポインタがコントロール上にあるときに ToolTip ウィンドウが表示される時間を短くしたり、長くしたりできます。たとえば、ツール ヒント ウィンドウに詳細なヘルプを表示する場合は、このプロパティの値を大きくして、テキストを読むための十分な時間をユーザーに与えることができます。

ツール ヒント ウィンドウに一貫した遅延パターンを設定する場合は、 AutomaticDelay プロパティを設定します。 AutomaticDelay プロパティは、 AutoPopDelayReshowDelayInitialDelay の各プロパティを単一の値に基づいた初期値に設定します。 AutomaticDelay プロパティを設定するたびに、 AutoPopDelay プロパティは AutomaticDelay プロパティ値の 10 倍の値に設定されます。 AutomaticDelay プロパティを設定すると、既定値をオーバーライドして、個別に AutoPopDelay プロパティを設定できます。

使用例

[Visual Basic, C#, C++] ToolTip クラスのインスタンスを作成し、そのインスタンスが内部に作成された Form に関連付ける例を次に示します。次に、このコードは AutoPopDelayInitialDelayReshowDelay の各遅延プロパティを初期化します。また、 ToolTip クラスのインスタンスで ShowAlways プロパティを true に設定して、フォームがアクティブかどうかに関係なく、ツール ヒント テキストが表示されるようにします。最後に、ツール ヒント テキストをフォーム上の 2 つのコントロール Button および CheckBox に関連付けます。この例は、コード内で定義されたメソッドが button1 という名前の Button コントロールおよび checkBox1 という名前の CheckBox コントロールを含む Form 内に配置されており、その Form のコンストラクタから呼び出されることを前提にしています。

 
' This example assumes that the Form_Load event handling method
' is connected to the Load event of the form.
Private Sub Form1_Load(sender As Object, e As System.EventArgs) Handles MyBase.Load
   ' Create the ToolTip and associate with the Form container.
   Dim toolTip1 As New ToolTip()
   
   ' Set up the delays for the ToolTip.
   toolTip1.AutoPopDelay = 5000
   toolTip1.InitialDelay = 1000
   toolTip1.ReshowDelay = 500
   ' Force the ToolTip text to be displayed whether or not the form is active.
   toolTip1.ShowAlways = True
   
   ' Set up the ToolTip text for the Button and Checkbox.
   toolTip1.SetToolTip(Me.button1, "My button1")
   toolTip1.SetToolTip(Me.checkBox1, "My checkBox1")
End Sub

[C#] 
// This example assumes that the Form_Load event handling method
// is connected to the Load event of the form.
private void Form1_Load(object sender, System.EventArgs e)
{
   // Create the ToolTip and associate with the Form container.
   ToolTip toolTip1 = new ToolTip();

   // Set up the delays for the ToolTip.
   toolTip1.AutoPopDelay = 5000;
   toolTip1.InitialDelay = 1000;
   toolTip1.ReshowDelay = 500;
   // Force the ToolTip text to be displayed whether or not the form is active.
   toolTip1.ShowAlways = true;
      
   // Set up the ToolTip text for the Button and Checkbox.
   toolTip1.SetToolTip(this.button1, "My button1");
   toolTip1.SetToolTip(this.checkBox1, "My checkBox1");
}

[C++] 
// This example assumes that the Form_Load event handling method
// is connected to the Load event of the form.
private:
void Form1_Load(Object* /*sender*/, System::EventArgs* /*e*/)
{
   // Create the ToolTip and associate with the Form container.
   ToolTip* toolTip1 = new ToolTip();

   // Set up the delays for the ToolTip.
   toolTip1->AutoPopDelay = 5000;
   toolTip1->InitialDelay = 1000;
   toolTip1->ReshowDelay = 500;
   // Force the ToolTip text to be displayed whether or not the form is active.
   toolTip1->ShowAlways = true;
      
   // Set up the ToolTip text for the Button and Checkbox.
   toolTip1->SetToolTip(this->button1, S"My button1");
   toolTip1->SetToolTip(this->checkBox1, S"My checkBox1");
}

[JScript] JScript のサンプルはありません。Visual Basic、C#、および C++ のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン 言語のフィルタ をクリックします。

必要条件

プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ

参照

ToolTip クラス | ToolTip メンバ | System.Windows.Forms 名前空間 | AutomaticDelay | InitialDelay | ReshowDelay