다음을 통해 공유


ToolTip 생성자

정의

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

오버로드

Name Description
ToolTip()

지정된 컨테이너가 없는 새 인스턴스를 ToolTip 초기화합니다.

ToolTip(IContainer)

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

ToolTip()

Source:
ToolTip.cs
Source:
ToolTip.cs
Source:
ToolTip.cs
Source:
ToolTip.cs
Source:
ToolTip.cs

지정된 컨테이너가 없는 새 인스턴스를 ToolTip 초기화합니다.

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

예제

다음 코드 예제에서는 클래스의 인스턴스를 ToolTip 만듭니다. 그런 다음, 이 코드는 지연 속성 AutoPopDelayInitialDelayReshowDelay. 또한 클래스의 인스턴스는 폼이 ToolTip 활성 상태인지 여부에 관계없이 도구 설명 텍스트를 표시할 수 있도록 속성을 true 설정합니다ShowAlways. 마지막으로, 이 예제에서는 도구 설명 텍스트를 폼의 컨트롤 2개와 a 및 a Button 와 연결합니다 CheckBox. 이 코드 예제에서는 예제에 정의된 메서드가 명명된 컨트롤과 CheckBox 명명 checkBox1,button1 된 컨트롤을 포함하고 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)

Source:
ToolTip.cs
Source:
ToolTip.cs
Source:
ToolTip.cs
Source:
ToolTip.cs
Source:
ToolTip.cs

지정된 컨테이너를 사용하여 클래스의 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. 애플리케이션에서 여러 구성 요소를 사용하고 동시에 모든 구성 요소를 삭제하려는 경우에 유용할 수 있습니다. 예를 들어 , , ImageList및 a DisposeTimerContainer를 연결ToolTip한 경우 호출 시 Container 이러한 모든 구성 요소를 강제로 삭제합니다.

추가 정보

적용 대상