ToolTip 생성자

정의

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

오버로드

ToolTip()

지정된 컨테이너를 사용하지 않고 ToolTip의 새 인스턴스를 초기화합니다.

ToolTip(IContainer)

지정된 컨테이너를 사용하여 ToolTip 클래스의 새 인스턴스를 초기화합니다.

ToolTip()

지정된 컨테이너를 사용하지 않고 ToolTip의 새 인스턴스를 초기화합니다.

public:
 ToolTip();
public ToolTip ();
Public Sub New ()

예제

다음 코드 예제에서는 클래스의 인스턴스를 ToolTip 만듭니다. 그런 다음, 코드는 지연 속성을 AutoPopDelay초기화하고 ReshowDelay. InitialDelay 또한 클래스의 ToolTip 인스턴스는 폼이 활성 상태인지 여부에 관계없이 ToolTip 텍스트를 표시할 수 있도록 속성을 true 설정합니다ShowAlways. 마지막으로, 이 예제에서는 도구 설명 텍스트를 폼 Button 의 컨트롤 1과 a CheckBox에 대한 두 개의 컨트롤과 연결합니다. 코드 예제에서는 예제에 정의된 메서드가 명명된 컨트롤과 CheckBox 명명 button1 checkBox1, 된 컨트롤을 포함하는 Button 메서드 내에 Form 있고 메서드가 생성자Form에서 호출되어야 합니다.

// 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.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 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

설명

이 생성자는 컨테이너와 연결되지 않은 ToolTip의 인스턴스를 만듭니다.

추가 정보

적용 대상

ToolTip(IContainer)

지정된 컨테이너를 사용하여 ToolTip 클래스의 새 인스턴스를 초기화합니다.

public:
 ToolTip(System::ComponentModel::IContainer ^ cont);
public ToolTip (System.ComponentModel.IContainer cont);
new System.Windows.Forms.ToolTip : System.ComponentModel.IContainer -> System.Windows.Forms.ToolTip
Public Sub New (cont As IContainer)

매개 변수

cont
IContainer

IContainer의 컨테이너를 나타내는 ToolTip입니다.

설명

ToolTip 생성자를 사용하면 모든 개체와 연결할 ToolTip 수 있습니다Container. 이러한 방식으로 연결하면 ToolTip 도구 설명 Container의 수명 제어를 . 이 기능은 애플리케이션에서 여러 구성 요소를 사용 하 고 동시에 모두 삭제 하려는 경우에 유용할 수 있습니다. 예를 들어, 연결 하는 경우는 ToolTip, ImageList및 a ContainerTimer 를 호출 Dispose Container 하 고 이러한 모든 구성 요소를 강제로 삭제 합니다.

추가 정보

적용 대상