HelpProvider 클래스

정의

컨트롤에 대한 팝업 또는 온라인 도움말을 제공합니다.

public ref class HelpProvider : System::ComponentModel::Component, System::ComponentModel::IExtenderProvider
public class HelpProvider : System.ComponentModel.Component, System.ComponentModel.IExtenderProvider
type HelpProvider = class
    inherit Component
    interface IExtenderProvider
Public Class HelpProvider
Inherits Component
Implements IExtenderProvider
상속
구현

예제

다음 코드 예제에서는 클래스를 HelpProvider 사용하여 네 개의 주소 필드가 포함된 양식에 상황에 맞는 도움말을 표시하는 방법을 보여 줍니다. 이 예제에서는 메서드를 SetHelpString 사용하여 도움말 도구 설명 텍스트를 설정합니다. 상황에 맞는 도움말 단추를 사용하고 주소 필드에서 도움말 커서를 클릭하면 지정된 텍스트와 함께 도움말 도구 설명이 나타납니다. 주소 필드에 포커스가 있는 F1 키를 누르면 속성이 mspaint.chm으로 설정되었기 때문에 HelpNamespace mspaint.chm 도움말 파일이 표시됩니다. SetShowHelp 이 메서드는 사용 가능한 도움말 콘텐츠가 있는지 식별하기 위해 각 주소 컨트롤에 대해 호출됩니다.

#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 );
}
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";
    }
}
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
    
    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
End Class

설명

각 인스턴스 HelpProvider 는 연결된 컨트롤에 대한 참조 컬렉션을 유지 관리합니다. 도움말 파일을 해당 파일과 HelpProvider연결하려면 속성을 설정합니다 HelpNamespace . 메서드를 호출 SetHelpNavigator 하고 지정된 컨트롤에 대한 값을 제공하여 HelpNavigator 제공되는 도움말 유형을 지정합니다. 메서드를 호출하여 도움말에 대한 키워드 또는 토픽을 SetHelpKeyword 제공합니다. 특정 항목에 대한 도움말을 열려면 form topicName.htm 키워드를 전달해야 합니다.

특정 도움말 문자열을 컨트롤과 연결하려면 메서드를 SetHelpString 사용합니다. 컨트롤에 포커스가 있는 동안 사용자가 F1 키를 누르면 이 메서드를 사용하여 컨트롤과 연결하는 문자열이 팝업 창에 표시됩니다.

속성이 HelpNamespace 설정되지 않은 경우 이 메서드를 SetHelpString 사용하여 도움말 텍스트를 제공해야 합니다. 도움말 문자열과 도움말 문자열을 모두 HelpNamespace 설정한 경우 도움말 기반 도움말이 HelpNamespace 우선적으로 적용됩니다.

HelpProvider 는 클래스에서 메서드를 Help 호출하여 도움말 기능을 제공합니다.

생성자

HelpProvider()

HelpProvider 클래스의 새 인스턴스를 초기화합니다.

속성

CanRaiseEvents

구성 요소가 이벤트를 발생시킬 수 있는지 여부를 나타내는 값을 가져옵니다.

(다음에서 상속됨 Component)
Container

IContainer을 포함하는 Component를 가져옵니다.

(다음에서 상속됨 Component)
DesignMode

Component가 현재 디자인 모드인지 여부를 나타내는 값을 가져옵니다.

(다음에서 상속됨 Component)
Events

Component에 연결된 이벤트 처리기의 목록을 가져옵니다.

(다음에서 상속됨 Component)
HelpNamespace

HelpProvider 개체와 관련된 도움말 파일의 이름을 지정하는 값을 가져오거나 설정합니다.

Site

ComponentISite를 가져오거나 설정합니다.

(다음에서 상속됨 Component)
Tag

HelpProvider에 대한 추가 데이터가 포함된 개체를 가져오거나 설정합니다.

메서드

CanExtend(Object)

이 개체가 지정된 개체에 Extender 속성을 제공할 수 있는지 여부를 지정합니다.

CreateObjRef(Type)

원격 개체와 통신하는 데 사용되는 프록시 생성에 필요한 모든 관련 정보가 들어 있는 개체를 만듭니다.

(다음에서 상속됨 MarshalByRefObject)
Dispose()

Component에서 사용하는 모든 리소스를 해제합니다.

(다음에서 상속됨 Component)
Dispose(Boolean)

Component에서 사용하는 관리되지 않는 리소스를 해제하고, 관리되는 리소스를 선택적으로 해제할 수 있습니다.

(다음에서 상속됨 Component)
Equals(Object)

지정된 개체가 현재 개체와 같은지 확인합니다.

(다음에서 상속됨 Object)
GetHashCode()

기본 해시 함수로 작동합니다.

(다음에서 상속됨 Object)
GetHelpKeyword(Control)

지정된 컨트롤에 대한 도움말 키워드를 반환합니다.

GetHelpNavigator(Control)

지정된 컨트롤에 대한 현재 HelpNavigator 설정을 반환합니다.

GetHelpString(Control)

지정된 컨트롤에 대한 팝업 도움말 창의 콘텐츠를 반환합니다.

GetLifetimeService()
사용되지 않습니다.

이 인스턴스의 수명 정책을 제어하는 현재의 수명 서비스 개체를 검색합니다.

(다음에서 상속됨 MarshalByRefObject)
GetService(Type)

Component 또는 해당 Container에서 제공하는 서비스를 나타내는 개체를 반환합니다.

(다음에서 상속됨 Component)
GetShowHelp(Control)

지정된 컨트롤의 도움말을 표시해야 하는지 여부를 나타내는 값을 반환합니다.

GetType()

현재 인스턴스의 Type을 가져옵니다.

(다음에서 상속됨 Object)
InitializeLifetimeService()
사용되지 않습니다.

이 인스턴스의 수명 정책을 제어하는 수명 서비스 개체를 가져옵니다.

(다음에서 상속됨 MarshalByRefObject)
MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
MemberwiseClone(Boolean)

현재 MarshalByRefObject 개체의 단순 복사본을 만듭니다.

(다음에서 상속됨 MarshalByRefObject)
ResetShowHelp(Control)

지정된 컨트롤과 연결된 도움말을 제거합니다.

SetHelpKeyword(Control, String)

사용자가 지정된 컨트롤에 대한 도움말을 호출할 때 도움말을 검색하는 데 사용되는 키워드를 지정합니다.

SetHelpNavigator(Control, HelpNavigator)

지정된 컨트롤의 도움말 파일에서 도움말을 검색할 때 사용할 도움말 명령을 지정합니다.

SetHelpString(Control, String)

지정된 컨트롤과 관련된 도움말 문자열을 지정합니다.

SetShowHelp(Control, Boolean)

지정된 컨트롤에 대해 도움말이 표시될지 여부를 지정합니다.

ToString()

현재 HelpProvider를 나타내는 문자열을 반환합니다.

이벤트

Disposed

Dispose() 메서드를 호출하여 구성 요소를 삭제할 때 발생합니다.

(다음에서 상속됨 Component)

적용 대상

추가 정보