HelpProviderとは? わかりやすく解説

HelpProvider イベント


HelpProvider クラス

コントロールのポップアップ ヘルプまたはオンライン ドキュメントを提供します。

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

Public Class HelpProvider
    Inherits Component
    Implements IExtenderProvider
public class HelpProvider : Component, IExtenderProvider
public ref class HelpProvider : public
 Component, IExtenderProvider
public class HelpProvider extends Component
 implements IExtenderProvider
public class HelpProvider extends
 Component implements IExtenderProvider
解説解説
使用例使用例

HelpProvider クラスを使用して、4 つのアドレス フィールドを含むフォームに状況依存のヘルプを表示するコード例を次に示します。この例では SetHelpString メソッドを使用して、ヘルプのツールヒント テキストを設定しています。状況依存のヘルプのボタンをクリックしてから、ヘルプ カーソルをアドレス フィールドに合わせてクリックすると、指定したテキストのヘルプ ツールヒントが表示されます。アドレス フィールドにフォーカスがあるときに F1 キーを押すと、HelpNamespace プロパティに mspaint.chm が設定されているため、mspaint.chm ヘルプ ファイルが表示されます。各アドレス コントロールについて SetShowHelp メソッドが呼び出され、ヘルプの内容が存在するかどうかが確認されます。

Imports System
Imports System.Drawing
Imports System.Windows.Forms

Public Class Form1
    Inherits System.Windows.Forms.Form
    Private addressTextBox As System.Windows.Forms.TextBox
    Private label2 As System.Windows.Forms.Label
    Private cityTextBox As System.Windows.Forms.TextBox
    Private label3 As System.Windows.Forms.Label
    Private stateTextBox As System.Windows.Forms.TextBox
    Private zipTextBox As System.Windows.Forms.TextBox
    Private helpProvider1 As System.Windows.Forms.HelpProvider
    Private helpLabel As System.Windows.Forms.Label

    <STAThread()>  _
    Shared Sub Main()
        Application.Run(New Form1())
    End Sub 'Main
    
    Public Sub New()
        Me.addressTextBox = New System.Windows.Forms.TextBox()
        Me.helpLabel = New System.Windows.Forms.Label()
        Me.label2 = New System.Windows.Forms.Label()
        Me.cityTextBox = New System.Windows.Forms.TextBox()
        Me.label3 = New System.Windows.Forms.Label()
        Me.stateTextBox = New System.Windows.Forms.TextBox()
        Me.zipTextBox = New System.Windows.Forms.TextBox()

        ' Help Label
        Me.helpLabel.Location = New System.Drawing.Point(8,
 80)
        Me.helpLabel.Size = New System.Drawing.Size(272,
 72)
        Me.helpLabel.TabIndex = 1
        Me.helpLabel.Text = "Click the Help
 button in the title bar, then click a control " & _
            "to see a Help tooltip for the control.  Click on
 a control and press F1 to invoke " & _
            "the Help system with a sample Help file."

        ' Address Label
        Me.label2.Location = New System.Drawing.Point(16,
 8)
        Me.label2.Size = New System.Drawing.Size(100,
 16)
        Me.label2.Text = "Address:"

        ' Comma Label
        Me.label3.Location = New System.Drawing.Point(136,
 56)
        Me.label3.Size = New System.Drawing.Size(16,
 16)
        Me.label3.Text = ","

        ' Creates the HelpProvider.
        Me.helpProvider1 = New System.Windows.Forms.HelpProvider()

        ' Tell the HelpProvider what controls to provide Help for, and
        ' what the Help string is.
        Me.helpProvider1.SetHelpString(Me.addressTextBox,
 "Enter the street address in this text box.")
        Me.helpProvider1.SetShowHelp(Me.addressTextBox,
 True)

        Me.helpProvider1.SetHelpString(Me.cityTextBox,
 "Enter the city here.")
        Me.helpProvider1.SetShowHelp(Me.cityTextBox,
 True)

        Me.helpProvider1.SetHelpString(Me.stateTextBox,
 "Enter the state in this text box.")
        Me.helpProvider1.SetShowHelp(Me.stateTextBox,
 True)

        Me.helpProvider1.SetHelpString(Me.zipTextBox,
 "Enter the zip code here.")
        Me.helpProvider1.SetShowHelp(Me.zipTextBox,
 True)

        ' Sets what the Help file will be for the HelpProvider.
        Me.helpProvider1.HelpNamespace = "mspaint.chm"

        ' Set properties for the different address fields.

        ' Address TextBox
        Me.addressTextBox.Location = New System.Drawing.Point(16,
 24)
        Me.addressTextBox.Size = New System.Drawing.Size(264,
 20)
        Me.addressTextBox.TabIndex = 0
        Me.addressTextBox.Text = ""


        ' City TextBox
        Me.cityTextBox.Location = New System.Drawing.Point(16,
 48)
        Me.cityTextBox.Size = New System.Drawing.Size(120,
 20)
        Me.cityTextBox.TabIndex = 3
        Me.cityTextBox.Text = ""

        ' State TextBox
        Me.stateTextBox.Location = New System.Drawing.Point(152,
 48)
        Me.stateTextBox.MaxLength = 2
        Me.stateTextBox.Size = New System.Drawing.Size(32,
 20)
        Me.stateTextBox.TabIndex = 5
        Me.stateTextBox.Text = ""

        ' Zip TextBox
        Me.zipTextBox.Location = New System.Drawing.Point(192,
 48)
        Me.zipTextBox.Size = New System.Drawing.Size(88,
 20)
        Me.zipTextBox.TabIndex = 6
        Me.zipTextBox.Text = ""

        ' Add the controls to the form.
        Me.Controls.AddRange(New System.Windows.Forms.Control()
 { Me.zipTextBox, _
                                       Me.stateTextBox, Me.label3,
 _
                                       Me.cityTextBox, Me.label2,
 _
                                       Me.helpLabel, Me.addressTextBox})

        ' Set the form to look like a dialog, and show the HelpButton.
    
        Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
        Me.HelpButton = True
        Me.MaximizeBox = False
        Me.MinimizeBox = False
        Me.ClientSize = New System.Drawing.Size(292,
 160)
        Me.Text = "Help Provider Demonstration"

    End Sub 'New        
End Class 'Form1
using System;
using System.Drawing;
using System.Windows.Forms;

public class Form1 : System.Windows.Forms.Form
{
    private System.Windows.Forms.TextBox addressTextBox;
    private System.Windows.Forms.Label label2;
    private System.Windows.Forms.TextBox cityTextBox;
    private System.Windows.Forms.Label label3;
    private System.Windows.Forms.TextBox stateTextBox;
    private System.Windows.Forms.TextBox zipTextBox;
    private System.Windows.Forms.HelpProvider helpProvider1;
    private System.Windows.Forms.Label helpLabel;

    [STAThread]
    static void Main() 
    {
        Application.Run(new Form1());
    }

    public Form1()
    {
        this.addressTextBox = new System.Windows.Forms.TextBox();
        this.helpLabel = new System.Windows.Forms.Label();
        this.label2 = new System.Windows.Forms.Label();
        this.cityTextBox = new System.Windows.Forms.TextBox();
        this.label3 = new System.Windows.Forms.Label();
        this.stateTextBox = new System.Windows.Forms.TextBox();
        this.zipTextBox = new System.Windows.Forms.TextBox();
        
        // Help Label
        this.helpLabel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
        this.helpLabel.Location = new System.Drawing.Point(8,
 80);
        this.helpLabel.Size = new System.Drawing.Size(272,
 72);
        this.helpLabel.Text = "Click the Help button in
 the title bar, then click a control " + 
            "to see a Help tooltip for the control.  Click
 on a control and press F1 to invoke " +
            "the Help system with a sample Help file.";

        // Address Label
        this.label2.Location = new System.Drawing.Point(16,
 8);
        this.label2.Size = new System.Drawing.Size(100,
 16);
        this.label2.Text = "Address:";

        // Comma Label
        this.label3.Location = new System.Drawing.Point(136,
 56);
        this.label3.Size = new System.Drawing.Size(16,
 16);
        this.label3.Text = ",";

        // Create the HelpProvider.
        this.helpProvider1 = new System.Windows.Forms.HelpProvider();

        // Tell the HelpProvider what controls to provide help for,
 and
        // what the help string is.
        this.helpProvider1.SetShowHelp(this.addressTextBox,
 true);
        this.helpProvider1.SetHelpString(this.addressTextBox,
 "Enter the street address in this text
 box.");

        this.helpProvider1.SetShowHelp(this.cityTextBox,
 true);
        this.helpProvider1.SetHelpString(this.cityTextBox,
 "Enter the city here.");

        this.helpProvider1.SetShowHelp(this.stateTextBox,
 true);
        this.helpProvider1.SetHelpString(this.stateTextBox,
 "Enter the state in this text box.");

        this.helpProvider1.SetShowHelp(this.zipTextBox,
 true);
        this.helpProvider1.SetHelpString(this.zipTextBox,
 "Enter the zip code here.");

        // Set what the Help file will be for the HelpProvider.
        this.helpProvider1.HelpNamespace = "mspaint.chm";

        // Sets properties for the different address fields.

        // Address TextBox
        this.addressTextBox.Location = new
 System.Drawing.Point(16, 24);
        this.addressTextBox.Size = new System.Drawing.Size(264,
 20);
        this.addressTextBox.TabIndex = 0;
        this.addressTextBox.Text = "";

        // City TextBox
        this.cityTextBox.Location = new System.Drawing.Point(16,
 48);
        this.cityTextBox.Size = new System.Drawing.Size(120,
 20);
        this.cityTextBox.TabIndex = 3;
        this.cityTextBox.Text = "";

        // State TextBox
        this.stateTextBox.Location = new System.Drawing.Point(152,
 48);
        this.stateTextBox.MaxLength = 2;
        this.stateTextBox.Size = new System.Drawing.Size(32,
 20);
        this.stateTextBox.TabIndex = 5;
        this.stateTextBox.Text = "";

        // Zip TextBox
        this.zipTextBox.Location = new System.Drawing.Point(192,
 48);
        this.zipTextBox.Size = new System.Drawing.Size(88,
 20);
        this.zipTextBox.TabIndex = 6;
        this.zipTextBox.Text = "";

        // Add the controls to the form.
        this.Controls.AddRange(new System.Windows.Forms.Control[]
 {
                                    this.zipTextBox, this.stateTextBox
,
                                    this.label3, this.cityTextBox
,
                                    this.label2, this.helpLabel
,
                                    this.addressTextBox});

        // Set the form to look like a dialog, and show the HelpButton.
    
        this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
        this.HelpButton = true;
        this.MaximizeBox = false;
        this.MinimizeBox = false;
        this.ClientSize = new System.Drawing.Size(292,
 160);
        this.Text = "Help Provider Demonstration";

    }
}
#using <System.dll>
#using <System.Windows.Forms.dll>
#using <System.Drawing.dll>

using namespace System;
using namespace System::Drawing;
using namespace System::Windows::Forms;
public ref class Form1: public
 System::Windows::Forms::Form
{
private:
   System::Windows::Forms::TextBox^ addressTextBox;
   System::Windows::Forms::Label ^ label2;
   System::Windows::Forms::TextBox^ cityTextBox;
   System::Windows::Forms::Label ^ label3;
   System::Windows::Forms::TextBox^ stateTextBox;
   System::Windows::Forms::TextBox^ zipTextBox;
   System::Windows::Forms::HelpProvider^ helpProvider1;
   System::Windows::Forms::Label ^ helpLabel;

public:
   Form1()
   {
      this->addressTextBox = gcnew System::Windows::Forms::TextBox;
      this->helpLabel = gcnew System::Windows::Forms::Label;
      this->label2 = gcnew System::Windows::Forms::Label;
      this->cityTextBox = gcnew System::Windows::Forms::TextBox;
      this->label3 = gcnew System::Windows::Forms::Label;
      this->stateTextBox = gcnew System::Windows::Forms::TextBox;
      this->zipTextBox = gcnew System::Windows::Forms::TextBox;
      
      // Help Label
      this->helpLabel->BorderStyle = System::Windows::Forms::BorderStyle::Fixed3D;
      this->helpLabel->Location = System::Drawing::Point(
 8, 80 );
      this->helpLabel->Size = System::Drawing::Size( 272,
 72 );
      this->helpLabel->Text = "Click the Help button
 in the title bar, then click a control to see a Help tooltip
 for the control.  Click on a control and press F1 to invoke the Help system with a sample Help file.";
      
      // Address Label
      this->label2->Location = System::Drawing::Point( 16,
 8 );
      this->label2->Size = System::Drawing::Size( 100, 16
 );
      this->label2->Text = "Address:";
      
      // Comma Label
      this->label3->Location = System::Drawing::Point( 136,
 56 );
      this->label3->Size = System::Drawing::Size( 16, 16
 );
      this->label3->Text = ", ";
      
      // Create the HelpProvider.
      this->helpProvider1 = gcnew System::Windows::Forms::HelpProvider;
      
      // Tell the HelpProvider what controls to provide help for, and
      // what the help String* is.
      this->helpProvider1->SetShowHelp( this->addressTextBox,
 true );
      this->helpProvider1->SetHelpString( this->addressTextBox,
 "Enter the street address in this text
 box." );
      this->helpProvider1->SetShowHelp( this->cityTextBox,
 true );
      this->helpProvider1->SetHelpString( this->cityTextBox,
 "Enter the city here." );
      this->helpProvider1->SetShowHelp( this->stateTextBox,
 true );
      this->helpProvider1->SetHelpString( this->stateTextBox,
 "Enter the state in this text box."
 );
      this->helpProvider1->SetShowHelp( this->zipTextBox,
 true );
      this->helpProvider1->SetHelpString( this->zipTextBox,
 "Enter the zip code here." );
      
      // Set what the Help file will be for the HelpProvider.
      this->helpProvider1->HelpNamespace = "mspaint.chm";
      
      // Sets properties for the different address fields.
      // Address TextBox
      this->addressTextBox->Location = System::Drawing::Point(
 16, 24 );
      this->addressTextBox->Size = System::Drawing::Size(
 264, 20 );
      this->addressTextBox->TabIndex = 0;
      this->addressTextBox->Text = "";
      
      // City TextBox
      this->cityTextBox->Location = System::Drawing::Point(
 16, 48 );
      this->cityTextBox->Size = System::Drawing::Size( 120,
 20 );
      this->cityTextBox->TabIndex = 3;
      this->cityTextBox->Text = "";
      
      // State TextBox
      this->stateTextBox->Location = System::Drawing::Point(
 152, 48 );
      this->stateTextBox->MaxLength = 2;
      this->stateTextBox->Size = System::Drawing::Size(
 32, 20 );
      this->stateTextBox->TabIndex = 5;
      this->stateTextBox->Text = "";
      
      // Zip TextBox
      this->zipTextBox->Location = System::Drawing::Point(
 192, 48 );
      this->zipTextBox->Size = System::Drawing::Size( 88,
 20 );
      this->zipTextBox->TabIndex = 6;
      this->zipTextBox->Text = "";
      
      // Add the controls to the form.
      array<System::Windows::Forms::Control^>^temp0 = {this->zipTextBox
,this->stateTextBox,this->label3,this->cityTextBox
,this->label2,this->helpLabel,this->addressTextBox};
      this->Controls->AddRange( temp0 );
      
      // Set the form to look like a dialog, and show the HelpButton.
      this->FormBorderStyle = System::Windows::Forms::FormBorderStyle::FixedDialog;
      this->HelpButton = true;
      this->MaximizeBox = false;
      this->MinimizeBox = false;
      this->ClientSize = System::Drawing::Size( 292, 160 );
      this->Text = "Help Provider Demonstration";
   }

};


[STAThread]
int main()
{
   Application::Run( gcnew Form1 );
}

import System.*;
import System.Drawing.*;
import System.Windows.Forms.*;

public class Form1 extends System.Windows.Forms.Form
{
    private System.Windows.Forms.TextBox addressTextBox;
    private System.Windows.Forms.Label label2;
    private System.Windows.Forms.TextBox cityTextBox;
    private System.Windows.Forms.Label label3;
    private System.Windows.Forms.TextBox stateTextBox;
    private System.Windows.Forms.TextBox zipTextBox;
    private System.Windows.Forms.HelpProvider helpProvider1;
    private System.Windows.Forms.Label helpLabel;

    /** @attribute STAThread()
     */
    public static void main(String[]
 args)
    {
        Application.Run(new Form1());
    } //main

    public Form1()
    {
        this.addressTextBox = new System.Windows.Forms.TextBox();
        this.helpLabel = new System.Windows.Forms.Label();
        this.label2 = new System.Windows.Forms.Label();
        this.cityTextBox = new System.Windows.Forms.TextBox();
        this.label3 = new System.Windows.Forms.Label();
        this.stateTextBox = new System.Windows.Forms.TextBox();
        this.zipTextBox = new System.Windows.Forms.TextBox();
        // Help Label
        this.helpLabel.set_BorderStyle(
            System.Windows.Forms.BorderStyle.Fixed3D);
        this.helpLabel.set_Location(new System.Drawing.Point(8,
 80));
        this.helpLabel.set_Size(new System.Drawing.Size(272,
 72));
        this.helpLabel.set_Text("Click the Help button in
 the title bar," 
            + " then click a control to see a Help tooltip for
 the " 
            + "control.  Click on a control and press F1 to invoke " 
            + "the Help system with a sample Help file.");
        // Address Label
        this.label2.set_Location(new System.Drawing.Point(16,
 8));
        this.label2.set_Size(new System.Drawing.Size(100,
 16));
        this.label2.set_Text("Address:");
        // Comma Label
        this.label3.set_Location(new System.Drawing.Point(136,
 56));
        this.label3.set_Size(new System.Drawing.Size(16,
 16));
        this.label3.set_Text(",");

        // Create the HelpProvider.
        this.helpProvider1 = new System.Windows.Forms.HelpProvider();

        // Tell the HelpProvider what controls to provide help for,
 and
        // what the help string is.
        this.helpProvider1.SetShowHelp(this.addressTextBox,
 true);
        this.helpProvider1.SetHelpString(this.addressTextBox,
 
            "Enter the street address in this
 text box.");

        this.helpProvider1.SetShowHelp(this.cityTextBox,
 true);
        this.helpProvider1.SetHelpString(this.cityTextBox,
 
            "Enter the city here.");

        this.helpProvider1.SetShowHelp(this.stateTextBox,
 true);
        this.helpProvider1.SetHelpString(this.stateTextBox,
 
            "Enter the state in this text
 box.");

        this.helpProvider1.SetShowHelp(this.zipTextBox,
 true);
        this.helpProvider1.SetHelpString(this.zipTextBox,
 
            "Enter the zip code here.");
        
        // Set what the Help file will be for the HelpProvider.
        this.helpProvider1.set_HelpNamespace("mspaint.chm");
        // Sets properties for the different address fields.
        // Address TextBox
        this.addressTextBox.set_Location(new
 System.Drawing.Point(16, 24));
        this.addressTextBox.set_Size(new System.Drawing.Size(264,
 20));
        this.addressTextBox.set_TabIndex(0);
        this.addressTextBox.set_Text("");
        // City TextBox
        this.cityTextBox.set_Location(new System.Drawing.Point(16,
 48));
        this.cityTextBox.set_Size(new System.Drawing.Size(120,
 20));
        this.cityTextBox.set_TabIndex(3);
        this.cityTextBox.set_Text("");
        // State TextBox
        this.stateTextBox.set_Location(new
 System.Drawing.Point(152, 48));
        this.stateTextBox.set_MaxLength(2);
        this.stateTextBox.set_Size(new System.Drawing.Size(32,
 20));
        this.stateTextBox.set_TabIndex(5);
        this.stateTextBox.set_Text("");
        // Zip TextBox
        this.zipTextBox.set_Location(new System.Drawing.Point(192,
 48));
        this.zipTextBox.set_Size(new System.Drawing.Size(88,
 20));
        this.zipTextBox.set_TabIndex(6);
        this.zipTextBox.set_Text("");
        // Add the controls to the form.
        this.get_Controls().AddRange(new System.Windows.Forms.Control[]
 { 
            this.zipTextBox, this.stateTextBox,
 this.label3, this.cityTextBox, 
            this.label2, this.helpLabel, this.addressTextBox
 });
        // Set the form to look like a dialog, and show the HelpButton.
    
        this.set_FormBorderStyle(
            System.Windows.Forms.FormBorderStyle.FixedDialog);
        this.set_HelpButton(true);
        this.set_MaximizeBox(false);
        this.set_MinimizeBox(false);
        this.set_ClientSize(new System.Drawing.Size(292,
 160));
        this.set_Text("Help Provider Demonstration");
    } //Form1 
} //Form1
継承階層継承階層
System.Object
   System.MarshalByRefObject
     System.ComponentModel.Component
      System.Windows.Forms.HelpProvider
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバの場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

HelpProvider コンストラクタ

HelpProvider クラスの新しいインスタンスを初期化します。

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

public HelpProvider ()
public:
HelpProvider ()
public HelpProvider ()
public function HelpProvider ()
解説解説

HelpProvider クラスのインスタンスを作成したら、HelpNamespace プロパティ、SetHelpKeyword メソッド、および SetHelpNavigator メソッドを使用して、コントロールにヘルプ トピックを関連付けます。

使用例使用例

HelpProvider クラスを使用して、4 つのアドレス フィールドを含むフォームに状況依存のヘルプを表示するコード例を次に示します。この例では SetHelpString メソッドを使用して、ヘルプのツールヒント テキストを設定しています。状況依存のヘルプのボタンをクリックしてから、ヘルプ カーソルをアドレス フィールドに合わせてクリックすると、指定したテキストのヘルプ ツールヒントが表示されます。HelpNamespace プロパティが mspaint.chm に設定されているため、アドレス フィールドにフォーカスがあるときに F1 キーを押すと、mspaint.chm ヘルプ ファイルが表示されます。SetShowHelp メソッドは、各アドレス コントロールに対して呼び出され、ヘルプの内容が存在するかどうかが確認されます。

Imports System
Imports System.Drawing
Imports System.Windows.Forms

Public Class Form1
    Inherits System.Windows.Forms.Form
    Private addressTextBox As System.Windows.Forms.TextBox
    Private label2 As System.Windows.Forms.Label
    Private cityTextBox As System.Windows.Forms.TextBox
    Private label3 As System.Windows.Forms.Label
    Private stateTextBox As System.Windows.Forms.TextBox
    Private zipTextBox As System.Windows.Forms.TextBox
    Private helpProvider1 As System.Windows.Forms.HelpProvider
    Private helpLabel As System.Windows.Forms.Label

    <STAThread()>  _
    Shared Sub Main()
        Application.Run(New Form1())
    End Sub 'Main
    
    Public Sub New()
        Me.addressTextBox = New System.Windows.Forms.TextBox()
        Me.helpLabel = New System.Windows.Forms.Label()
        Me.label2 = New System.Windows.Forms.Label()
        Me.cityTextBox = New System.Windows.Forms.TextBox()
        Me.label3 = New System.Windows.Forms.Label()
        Me.stateTextBox = New System.Windows.Forms.TextBox()
        Me.zipTextBox = New System.Windows.Forms.TextBox()

        ' Help Label
        Me.helpLabel.Location = New System.Drawing.Point(8,
 80)
        Me.helpLabel.Size = New System.Drawing.Size(272,
 72)
        Me.helpLabel.TabIndex = 1
        Me.helpLabel.Text = "Click the Help
 button in the title bar, then click a control " & _
            "to see a Help tooltip for the control.  Click on
 a control and press F1 to invoke " & _
            "the Help system with a sample Help file."

        ' Address Label
        Me.label2.Location = New System.Drawing.Point(16,
 8)
        Me.label2.Size = New System.Drawing.Size(100,
 16)
        Me.label2.Text = "Address:"

        ' Comma Label
        Me.label3.Location = New System.Drawing.Point(136,
 56)
        Me.label3.Size = New System.Drawing.Size(16,
 16)
        Me.label3.Text = ","

        ' Creates the HelpProvider.
        Me.helpProvider1 = New System.Windows.Forms.HelpProvider()

        ' Tell the HelpProvider what controls to provide Help for, and
        ' what the Help string is.
        Me.helpProvider1.SetHelpString(Me.addressTextBox,
 "Enter the street address in this text box.")
        Me.helpProvider1.SetShowHelp(Me.addressTextBox,
 True)

        Me.helpProvider1.SetHelpString(Me.cityTextBox,
 "Enter the city here.")
        Me.helpProvider1.SetShowHelp(Me.cityTextBox,
 True)

        Me.helpProvider1.SetHelpString(Me.stateTextBox,
 "Enter the state in this text box.")
        Me.helpProvider1.SetShowHelp(Me.stateTextBox,
 True)

        Me.helpProvider1.SetHelpString(Me.zipTextBox,
 "Enter the zip code here.")
        Me.helpProvider1.SetShowHelp(Me.zipTextBox,
 True)

        ' Sets what the Help file will be for the HelpProvider.
        Me.helpProvider1.HelpNamespace = "mspaint.chm"

        ' Set properties for the different address fields.

        ' Address TextBox
        Me.addressTextBox.Location = New System.Drawing.Point(16,
 24)
        Me.addressTextBox.Size = New System.Drawing.Size(264,
 20)
        Me.addressTextBox.TabIndex = 0
        Me.addressTextBox.Text = ""


        ' City TextBox
        Me.cityTextBox.Location = New System.Drawing.Point(16,
 48)
        Me.cityTextBox.Size = New System.Drawing.Size(120,
 20)
        Me.cityTextBox.TabIndex = 3
        Me.cityTextBox.Text = ""

        ' State TextBox
        Me.stateTextBox.Location = New System.Drawing.Point(152,
 48)
        Me.stateTextBox.MaxLength = 2
        Me.stateTextBox.Size = New System.Drawing.Size(32,
 20)
        Me.stateTextBox.TabIndex = 5
        Me.stateTextBox.Text = ""

        ' Zip TextBox
        Me.zipTextBox.Location = New System.Drawing.Point(192,
 48)
        Me.zipTextBox.Size = New System.Drawing.Size(88,
 20)
        Me.zipTextBox.TabIndex = 6
        Me.zipTextBox.Text = ""

        ' Add the controls to the form.
        Me.Controls.AddRange(New System.Windows.Forms.Control()
 { Me.zipTextBox, _
                                       Me.stateTextBox, Me.label3,
 _
                                       Me.cityTextBox, Me.label2,
 _
                                       Me.helpLabel, Me.addressTextBox})

        ' Set the form to look like a dialog, and show the HelpButton.
    
        Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
        Me.HelpButton = True
        Me.MaximizeBox = False
        Me.MinimizeBox = False
        Me.ClientSize = New System.Drawing.Size(292,
 160)
        Me.Text = "Help Provider Demonstration"

    End Sub 'New        
End Class 'Form1
using System;
using System.Drawing;
using System.Windows.Forms;

public class Form1 : System.Windows.Forms.Form
{
    private System.Windows.Forms.TextBox addressTextBox;
    private System.Windows.Forms.Label label2;
    private System.Windows.Forms.TextBox cityTextBox;
    private System.Windows.Forms.Label label3;
    private System.Windows.Forms.TextBox stateTextBox;
    private System.Windows.Forms.TextBox zipTextBox;
    private System.Windows.Forms.HelpProvider helpProvider1;
    private System.Windows.Forms.Label helpLabel;

    [STAThread]
    static void Main() 
    {
        Application.Run(new Form1());
    }

    public Form1()
    {
        this.addressTextBox = new System.Windows.Forms.TextBox();
        this.helpLabel = new System.Windows.Forms.Label();
        this.label2 = new System.Windows.Forms.Label();
        this.cityTextBox = new System.Windows.Forms.TextBox();
        this.label3 = new System.Windows.Forms.Label();
        this.stateTextBox = new System.Windows.Forms.TextBox();
        this.zipTextBox = new System.Windows.Forms.TextBox();
        
        // Help Label
        this.helpLabel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
        this.helpLabel.Location = new System.Drawing.Point(8,
 80);
        this.helpLabel.Size = new System.Drawing.Size(272,
 72);
        this.helpLabel.Text = "Click the Help button in
 the title bar, then click a control " + 
            "to see a Help tooltip for the control.  Click
 on a control and press F1 to invoke " +
            "the Help system with a sample Help file.";

        // Address Label
        this.label2.Location = new System.Drawing.Point(16,
 8);
        this.label2.Size = new System.Drawing.Size(100,
 16);
        this.label2.Text = "Address:";

        // Comma Label
        this.label3.Location = new System.Drawing.Point(136,
 56);
        this.label3.Size = new System.Drawing.Size(16,
 16);
        this.label3.Text = ",";

        // Create the HelpProvider.
        this.helpProvider1 = new System.Windows.Forms.HelpProvider();

        // Tell the HelpProvider what controls to provide help for,
 and
        // what the help string is.
        this.helpProvider1.SetShowHelp(this.addressTextBox,
 true);
        this.helpProvider1.SetHelpString(this.addressTextBox,
 "Enter the street address in this text
 box.");

        this.helpProvider1.SetShowHelp(this.cityTextBox,
 true);
        this.helpProvider1.SetHelpString(this.cityTextBox,
 "Enter the city here.");

        this.helpProvider1.SetShowHelp(this.stateTextBox,
 true);
        this.helpProvider1.SetHelpString(this.stateTextBox,
 "Enter the state in this text box.");

        this.helpProvider1.SetShowHelp(this.zipTextBox,
 true);
        this.helpProvider1.SetHelpString(this.zipTextBox,
 "Enter the zip code here.");

        // Set what the Help file will be for the HelpProvider.
        this.helpProvider1.HelpNamespace = "mspaint.chm";

        // Sets properties for the different address fields.

        // Address TextBox
        this.addressTextBox.Location = new
 System.Drawing.Point(16, 24);
        this.addressTextBox.Size = new System.Drawing.Size(264,
 20);
        this.addressTextBox.TabIndex = 0;
        this.addressTextBox.Text = "";

        // City TextBox
        this.cityTextBox.Location = new System.Drawing.Point(16,
 48);
        this.cityTextBox.Size = new System.Drawing.Size(120,
 20);
        this.cityTextBox.TabIndex = 3;
        this.cityTextBox.Text = "";

        // State TextBox
        this.stateTextBox.Location = new System.Drawing.Point(152,
 48);
        this.stateTextBox.MaxLength = 2;
        this.stateTextBox.Size = new System.Drawing.Size(32,
 20);
        this.stateTextBox.TabIndex = 5;
        this.stateTextBox.Text = "";

        // Zip TextBox
        this.zipTextBox.Location = new System.Drawing.Point(192,
 48);
        this.zipTextBox.Size = new System.Drawing.Size(88,
 20);
        this.zipTextBox.TabIndex = 6;
        this.zipTextBox.Text = "";

        // Add the controls to the form.
        this.Controls.AddRange(new System.Windows.Forms.Control[]
 {
                                    this.zipTextBox, this.stateTextBox
,
                                    this.label3, this.cityTextBox
,
                                    this.label2, this.helpLabel
,
                                    this.addressTextBox});

        // Set the form to look like a dialog, and show the HelpButton.
    
        this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
        this.HelpButton = true;
        this.MaximizeBox = false;
        this.MinimizeBox = false;
        this.ClientSize = new System.Drawing.Size(292,
 160);
        this.Text = "Help Provider Demonstration";

    }
}
#using <System.dll>
#using <System.Windows.Forms.dll>
#using <System.Drawing.dll>

using namespace System;
using namespace System::Drawing;
using namespace System::Windows::Forms;
public ref class Form1: public
 System::Windows::Forms::Form
{
private:
   System::Windows::Forms::TextBox^ addressTextBox;
   System::Windows::Forms::Label ^ label2;
   System::Windows::Forms::TextBox^ cityTextBox;
   System::Windows::Forms::Label ^ label3;
   System::Windows::Forms::TextBox^ stateTextBox;
   System::Windows::Forms::TextBox^ zipTextBox;
   System::Windows::Forms::HelpProvider^ helpProvider1;
   System::Windows::Forms::Label ^ helpLabel;

public:
   Form1()
   {
      this->addressTextBox = gcnew System::Windows::Forms::TextBox;
      this->helpLabel = gcnew System::Windows::Forms::Label;
      this->label2 = gcnew System::Windows::Forms::Label;
      this->cityTextBox = gcnew System::Windows::Forms::TextBox;
      this->label3 = gcnew System::Windows::Forms::Label;
      this->stateTextBox = gcnew System::Windows::Forms::TextBox;
      this->zipTextBox = gcnew System::Windows::Forms::TextBox;
      
      // Help Label
      this->helpLabel->BorderStyle = System::Windows::Forms::BorderStyle::Fixed3D;
      this->helpLabel->Location = System::Drawing::Point(
 8, 80 );
      this->helpLabel->Size = System::Drawing::Size( 272,
 72 );
      this->helpLabel->Text = "Click the Help button
 in the title bar, then click a control to see a Help tooltip
 for the control.  Click on a control and press F1 to invoke the Help system with a sample Help file.";
      
      // Address Label
      this->label2->Location = System::Drawing::Point( 16,
 8 );
      this->label2->Size = System::Drawing::Size( 100, 16
 );
      this->label2->Text = "Address:";
      
      // Comma Label
      this->label3->Location = System::Drawing::Point( 136,
 56 );
      this->label3->Size = System::Drawing::Size( 16, 16
 );
      this->label3->Text = ", ";
      
      // Create the HelpProvider.
      this->helpProvider1 = gcnew System::Windows::Forms::HelpProvider;
      
      // Tell the HelpProvider what controls to provide help for, and
      // what the help String* is.
      this->helpProvider1->SetShowHelp( this->addressTextBox,
 true );
      this->helpProvider1->SetHelpString( this->addressTextBox,
 "Enter the street address in this text
 box." );
      this->helpProvider1->SetShowHelp( this->cityTextBox,
 true );
      this->helpProvider1->SetHelpString( this->cityTextBox,
 "Enter the city here." );
      this->helpProvider1->SetShowHelp( this->stateTextBox,
 true );
      this->helpProvider1->SetHelpString( this->stateTextBox,
 "Enter the state in this text box."
 );
      this->helpProvider1->SetShowHelp( this->zipTextBox,
 true );
      this->helpProvider1->SetHelpString( this->zipTextBox,
 "Enter the zip code here." );
      
      // Set what the Help file will be for the HelpProvider.
      this->helpProvider1->HelpNamespace = "mspaint.chm";
      
      // Sets properties for the different address fields.
      // Address TextBox
      this->addressTextBox->Location = System::Drawing::Point(
 16, 24 );
      this->addressTextBox->Size = System::Drawing::Size(
 264, 20 );
      this->addressTextBox->TabIndex = 0;
      this->addressTextBox->Text = "";
      
      // City TextBox
      this->cityTextBox->Location = System::Drawing::Point(
 16, 48 );
      this->cityTextBox->Size = System::Drawing::Size( 120,
 20 );
      this->cityTextBox->TabIndex = 3;
      this->cityTextBox->Text = "";
      
      // State TextBox
      this->stateTextBox->Location = System::Drawing::Point(
 152, 48 );
      this->stateTextBox->MaxLength = 2;
      this->stateTextBox->Size = System::Drawing::Size(
 32, 20 );
      this->stateTextBox->TabIndex = 5;
      this->stateTextBox->Text = "";
      
      // Zip TextBox
      this->zipTextBox->Location = System::Drawing::Point(
 192, 48 );
      this->zipTextBox->Size = System::Drawing::Size( 88,
 20 );
      this->zipTextBox->TabIndex = 6;
      this->zipTextBox->Text = "";
      
      // Add the controls to the form.
      array<System::Windows::Forms::Control^>^temp0 = {this->zipTextBox
,this->stateTextBox,this->label3,this->cityTextBox
,this->label2,this->helpLabel,this->addressTextBox};
      this->Controls->AddRange( temp0 );
      
      // Set the form to look like a dialog, and show the HelpButton.
      this->FormBorderStyle = System::Windows::Forms::FormBorderStyle::FixedDialog;
      this->HelpButton = true;
      this->MaximizeBox = false;
      this->MinimizeBox = false;
      this->ClientSize = System::Drawing::Size( 292, 160 );
      this->Text = "Help Provider Demonstration";
   }

};


[STAThread]
int main()
{
   Application::Run( gcnew Form1 );
}

import System.*;
import System.Drawing.*;
import System.Windows.Forms.*;

public class Form1 extends System.Windows.Forms.Form
{
    private System.Windows.Forms.TextBox addressTextBox;
    private System.Windows.Forms.Label label2;
    private System.Windows.Forms.TextBox cityTextBox;
    private System.Windows.Forms.Label label3;
    private System.Windows.Forms.TextBox stateTextBox;
    private System.Windows.Forms.TextBox zipTextBox;
    private System.Windows.Forms.HelpProvider helpProvider1;
    private System.Windows.Forms.Label helpLabel;

    /** @attribute STAThread()
     */
    public static void main(String[]
 args)
    {
        Application.Run(new Form1());
    } //main

    public Form1()
    {
        this.addressTextBox = new System.Windows.Forms.TextBox();
        this.helpLabel = new System.Windows.Forms.Label();
        this.label2 = new System.Windows.Forms.Label();
        this.cityTextBox = new System.Windows.Forms.TextBox();
        this.label3 = new System.Windows.Forms.Label();
        this.stateTextBox = new System.Windows.Forms.TextBox();
        this.zipTextBox = new System.Windows.Forms.TextBox();
        // Help Label
        this.helpLabel.set_BorderStyle(
            System.Windows.Forms.BorderStyle.Fixed3D);
        this.helpLabel.set_Location(new System.Drawing.Point(8,
 80));
        this.helpLabel.set_Size(new System.Drawing.Size(272,
 72));
        this.helpLabel.set_Text("Click the Help button in
 the title bar," 
            + " then click a control to see a Help tooltip for
 the " 
            + "control.  Click on a control and press F1 to invoke " 
            + "the Help system with a sample Help file.");
        // Address Label
        this.label2.set_Location(new System.Drawing.Point(16,
 8));
        this.label2.set_Size(new System.Drawing.Size(100,
 16));
        this.label2.set_Text("Address:");
        // Comma Label
        this.label3.set_Location(new System.Drawing.Point(136,
 56));
        this.label3.set_Size(new System.Drawing.Size(16,
 16));
        this.label3.set_Text(",");

        // Create the HelpProvider.
        this.helpProvider1 = new System.Windows.Forms.HelpProvider();

        // Tell the HelpProvider what controls to provide help for,
 and
        // what the help string is.
        this.helpProvider1.SetShowHelp(this.addressTextBox,
 true);
        this.helpProvider1.SetHelpString(this.addressTextBox,
 
            "Enter the street address in this
 text box.");

        this.helpProvider1.SetShowHelp(this.cityTextBox,
 true);
        this.helpProvider1.SetHelpString(this.cityTextBox,
 
            "Enter the city here.");

        this.helpProvider1.SetShowHelp(this.stateTextBox,
 true);
        this.helpProvider1.SetHelpString(this.stateTextBox,
 
            "Enter the state in this text
 box.");

        this.helpProvider1.SetShowHelp(this.zipTextBox,
 true);
        this.helpProvider1.SetHelpString(this.zipTextBox,
 
            "Enter the zip code here.");
        
        // Set what the Help file will be for the HelpProvider.
        this.helpProvider1.set_HelpNamespace("mspaint.chm");
        // Sets properties for the different address fields.
        // Address TextBox
        this.addressTextBox.set_Location(new
 System.Drawing.Point(16, 24));
        this.addressTextBox.set_Size(new System.Drawing.Size(264,
 20));
        this.addressTextBox.set_TabIndex(0);
        this.addressTextBox.set_Text("");
        // City TextBox
        this.cityTextBox.set_Location(new System.Drawing.Point(16,
 48));
        this.cityTextBox.set_Size(new System.Drawing.Size(120,
 20));
        this.cityTextBox.set_TabIndex(3);
        this.cityTextBox.set_Text("");
        // State TextBox
        this.stateTextBox.set_Location(new
 System.Drawing.Point(152, 48));
        this.stateTextBox.set_MaxLength(2);
        this.stateTextBox.set_Size(new System.Drawing.Size(32,
 20));
        this.stateTextBox.set_TabIndex(5);
        this.stateTextBox.set_Text("");
        // Zip TextBox
        this.zipTextBox.set_Location(new System.Drawing.Point(192,
 48));
        this.zipTextBox.set_Size(new System.Drawing.Size(88,
 20));
        this.zipTextBox.set_TabIndex(6);
        this.zipTextBox.set_Text("");
        // Add the controls to the form.
        this.get_Controls().AddRange(new System.Windows.Forms.Control[]
 { 
            this.zipTextBox, this.stateTextBox,
 this.label3, this.cityTextBox, 
            this.label2, this.helpLabel, this.addressTextBox
 });
        // Set the form to look like a dialog, and show the HelpButton.
    
        this.set_FormBorderStyle(
            System.Windows.Forms.FormBorderStyle.FixedDialog);
        this.set_HelpButton(true);
        this.set_MaximizeBox(false);
        this.set_MinimizeBox(false);
        this.set_ClientSize(new System.Drawing.Size(292,
 160));
        this.set_Text("Help Provider Demonstration");
    } //Form1 
} //Form1
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

HelpProvider プロパティ


HelpProvider メソッド


パブリック メソッドパブリック メソッド

( プロテクト メソッド も参照)
  名前 説明
パブリック メソッド CanExtend オブジェクトが、指定したオブジェクトに対してエクステンダ プロパティを提供できるかどうかを指定します。
パブリック メソッド CreateObjRef  リモート オブジェクトとの通信に使用するプロキシの生成に必要な情報をすべて格納しているオブジェクトを作成します。 ( MarshalByRefObject から継承されます。)
パブリック メソッド Dispose  オーバーロードされます。 Component によって使用されているリソースを解放します。 ( Component から継承されます。)
パブリック メソッド Equals  オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 ( Object から継承されます。)
パブリック メソッド GetHashCode  特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 ( Object から継承されます。)
パブリック メソッド GetHelpKeyword 指定したコントロールのヘルプ キーワードを返します。
パブリック メソッド GetHelpNavigator 指定したコントロールの現在の HelpNavigator の設定値を返します。
パブリック メソッド GetHelpString 指定したコントロールのポップアップ ヘルプ ウィンドウの内容を返します。
パブリック メソッド GetLifetimeService  対象のインスタンスの有効期間ポリシーを制御する、現在の有効期間サービス オブジェクトを取得します。 ( MarshalByRefObject から継承されます。)
パブリック メソッド GetShowHelp 指定したコントロールのヘルプを表示する必要があるかどうかを示す値を返します。
パブリック メソッド GetType  現在のインスタンスの Type を取得します。 ( Object から継承されます。)
パブリック メソッド InitializeLifetimeService  対象のインスタンスの有効期間ポリシーを制御する、有効期間サービス オブジェクトを取得します。 ( MarshalByRefObject から継承されます。)
パブリック メソッド ReferenceEquals  指定した複数の Object インスタンスが同一かどうかを判断します。 ( Object から継承されます。)
パブリック メソッド ResetShowHelp 指定したコントロールに関連付けられているヘルプを削除します。
パブリック メソッド SetHelpKeyword ユーザーが指定したコントロールのヘルプを呼び出すときに、ヘルプを検索するために使用するキーワードを指定します。
パブリック メソッド SetHelpNavigator 指定したコントロールのヘルプ ファイルからヘルプを検索するときに使用する、ヘルプ コマンドを指定します。
パブリック メソッド SetHelpString 指定したコントロールに関連付けられたヘルプ文字列を指定します。
パブリック メソッド SetShowHelp 指定したコントロールのヘルプを表示するかどうかを指定します。
パブリック メソッド ToString オーバーライドされます。 現在の HelpProvider を表す文字列を返します。
プロテクト メソッドプロテクト メソッド
参照参照

HelpProvider メンバ

コントロールのポップアップ ヘルプまたはオンライン ドキュメントを提供します。

HelpProvider データ型で公開されるメンバを以下の表に示します。


パブリック コンストラクタパブリック コンストラクタ
  名前 説明
パブリック メソッド HelpProvider HelpProvider クラスの新しいインスタンスを初期化します。
パブリック プロパティパブリック プロパティ
プロテクト プロパティプロテクト プロパティ
パブリック メソッドパブリック メソッド
( プロテクト メソッド も参照)
  名前 説明
パブリック メソッド CanExtend オブジェクトが、指定したオブジェクトに対してエクステンダ プロパティを提供できるかどうかを指定します。
パブリック メソッド CreateObjRef  リモート オブジェクトとの通信に使用するプロキシの生成に必要な情報をすべて格納しているオブジェクトを作成します。 (MarshalByRefObject から継承されます。)
パブリック メソッド Dispose  オーバーロードされます。 Component によって使用されているリソースを解放します。 (Component から継承されます。)
パブリック メソッド Equals  オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 (Object から継承されます。)
パブリック メソッド GetHashCode  特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 (Object から継承されます。)
パブリック メソッド GetHelpKeyword 指定したコントロールのヘルプ キーワードを返します。
パブリック メソッド GetHelpNavigator 指定したコントロールの現在の HelpNavigator の設定値を返します。
パブリック メソッド GetHelpString 指定したコントロールのポップアップ ヘルプ ウィンドウの内容を返します。
パブリック メソッド GetLifetimeService  対象のインスタンスの有効期間ポリシーを制御する、現在の有効期間サービス オブジェクトを取得します。 (MarshalByRefObject から継承されます。)
パブリック メソッド GetShowHelp 指定したコントロールのヘルプを表示する必要があるかどうかを示す値を返します。
パブリック メソッド GetType  現在のインスタンスの Type を取得します。 (Object から継承されます。)
パブリック メソッド InitializeLifetimeService  対象のインスタンスの有効期間ポリシーを制御する、有効期間サービス オブジェクトを取得します。 (MarshalByRefObject から継承されます。)
パブリック メソッド ReferenceEquals  指定した複数の Object インスタンスが同一かどうかを判断します。 (Object から継承されます。)
パブリック メソッド ResetShowHelp 指定したコントロールに関連付けられているヘルプを削除します。
パブリック メソッド SetHelpKeyword ユーザーが指定したコントロールのヘルプを呼び出すときに、ヘルプを検索するために使用するキーワードを指定します。
パブリック メソッド SetHelpNavigator 指定したコントロールのヘルプ ファイルからヘルプを検索するときに使用する、ヘルプ コマンドを指定します。
パブリック メソッド SetHelpString 指定したコントロールに関連付けられたヘルプ文字列を指定します。
パブリック メソッド SetShowHelp 指定したコントロールのヘルプを表示するかどうかを指定します。
パブリック メソッド ToString オーバーライドされます。 現在の HelpProvider を表す文字列を返します。
プロテクト メソッドプロテクト メソッド
パブリック イベントパブリック イベント
参照参照



英和和英テキスト翻訳

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

辞書ショートカット

すべての辞書の索引

「HelpProvider」の関連用語

HelpProviderのお隣キーワード
検索ランキング

   

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



HelpProviderのページの著作権

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

©2026 GRAS Group, Inc.RSS