ToolTip文字列は、コードまたは Visual Studio の Windows フォーム デザイナーで設定できます。 ToolTip コンポーネントの詳細については、「ツールヒント コンポーネントの概要」を参照してください。
プログラムでツールヒントを設定する
ツールヒントを表示するコントロールを追加します。
SetToolTip コンポーネントの ToolTip メソッドを使用します。
' In this example, Button1 is the control to display the ToolTip. ToolTip1.SetToolTip(Button1, "Save changes")
// In this example, button1 is the control to display the ToolTip. toolTip1.SetToolTip(button1, "Save changes");
// In this example, button1 is the control to display the ToolTip. toolTip1->SetToolTip(button1, "Save changes");
デザイナーでツールヒントを設定する
Visual Studio で、 ToolTip コンポーネントをフォームに追加します。
ツールヒントを表示するコントロールを選択するか、フォームに追加します。
[ プロパティ ] ウィンドウで、 ToolTip1 の ToolTip 値を適切なテキスト文字列に設定します。
プログラムでツールヒントを削除するには
SetToolTip コンポーネントの ToolTip メソッドを使用します。
' In this example, Button1 is the control displaying the ToolTip. ToolTip1.SetToolTip(Button1, Nothing)
// In this example, button1 is the control displaying the ToolTip. toolTip1.SetToolTip(button1, null);
// In this example, button1 is the control displaying the ToolTip. toolTip1->SetToolTip(button1, NULL);
デザイナーでツールヒントを削除する
Visual Studio で、ツールヒントを表示しているコントロールを選択します。
[ プロパティ ] ウィンドウで、 ToolTip1 のツールヒントのテキストを削除します。
こちらも参照ください
GitHub で Microsoft と共同作業する
このコンテンツのソースは GitHub にあります。そこで、issue や pull request を作成および確認することもできます。 詳細については、共同作成者ガイドを参照してください。
.NET Desktop feedback