ToolTip.SetToolTip メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > ToolTip.SetToolTip メソッドの意味・解説 

ToolTip.SetToolTip メソッド

指定したコントロールツール ヒント テキスト関連付けます。

名前空間: System.Windows.Forms
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)
構文構文

解説解説
使用例使用例

ToolTip クラスインスタンス作成し、それを作成した場所である Form に、このインスタンス関連付けるコード例次に示します次に、このコードは AutoPopDelay、InitialDelay、ReshowDelay の各遅延プロパティ初期化します。また、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
// 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");
}
// This example assumes that the Form_Load event handling method
// is connected to the Load event of the form.
void Form1_Load( Object^ sender, System::EventArgs^ e )
{
   // Create the ToolTip and associate with the Form container.
   ToolTip^ toolTip1 = gcnew 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"
 );
}
// 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.set_AutoPopDelay(5000);
    toolTip1.set_InitialDelay(1000);
    toolTip1.set_ReshowDelay(500);
    // Force the ToolTip text to be displayed whether or not the form
    // is active.
    toolTip1.set_ShowAlways(true);
    // Set up the ToolTip text for the Button and Checkbox.
    toolTip1.SetToolTip(this.button1, "My button1");
    toolTip1.SetToolTip(this.checkBox1, "My checkBox1");
} //Form1_Load
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


このページでは「.NET Framework クラス ライブラリ リファレンス」からToolTip.SetToolTip メソッドを検索した結果を表示しています。
Weblioに収録されているすべての辞書からToolTip.SetToolTip メソッドを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からToolTip.SetToolTip メソッド を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「ToolTip.SetToolTip メソッド」の関連用語

ToolTip.SetToolTip メソッドのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



ToolTip.SetToolTip メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS