다음을 통해 공유


ToolTip.ShowAlways 속성

부모 컨트롤이 활성화되지 않은 경우에도 도구 설명 창이 표시되는지 여부를 나타내는 값을 가져오거나 설정합니다.

네임스페이스: System.Windows.Forms
어셈블리: System.Windows.Forms(system.windows.forms.dll)

구문

‘선언
Public Property ShowAlways As Boolean
‘사용 방법
Dim instance As ToolTip
Dim value As Boolean

value = instance.ShowAlways

instance.ShowAlways = value
public bool ShowAlways { get; set; }
public:
property bool ShowAlways {
    bool get ();
    void set (bool value);
}
/** @property */
public boolean get_ShowAlways ()

/** @property */
public void set_ShowAlways (boolean value)
public function get ShowAlways () : boolean

public function set ShowAlways (value : boolean)

속성 값

도구 설명이 항상 표시되면 true이고, 그렇지 않으면 false입니다. 기본값은 false입니다.

설명

ShowAlways 속성을 사용하면 ToolTip의 컨테이너가 활성화되지 않은 경우에도 도구 설명 창을 표시할 수 있습니다. 모덜리스 창 응용 프로그램에서 이 기능을 사용하면 해당 모덜리스 창이 활성화되었는지 여부와 관계없이 도구 설명 창이 표시되게 할 수 있습니다. 이 기능은 도구 설명 창을 표시하는 여러 컨트롤이 포함된 UserControl을 사용하여 컨트롤을 만드는 경우에도 유용합니다. UserControl은 대개 폼에서 활성 창이 아니기 때문에 이 속성을 true로 설정하면 UserControl에 포함된 컨트롤의 도구 설명 창이 항상 표시되도록 할 수 있습니다.

예제

다음 코드 예제에서는 ToolTip 클래스의 인스턴스를 만든 다음 이 인스턴스가 만들어진 Form과 연결합니다. 그런 다음 지연 속성(AutoPopDelay, InitialDelayReshowDelay)을 초기화합니다 또한 ToolTip 클래스의 인스턴스는 ShowAlways 속성을 true로 설정하여 해당 폼의 활성화 여부에 관계없이 도구 설명 텍스트가 항상 표시되도록 합니다. 마지막으로 이 예제에서는 도구 설명 텍스트를 폼에 있는 두 개의 컨트롤(ButtonCheckBox)과 연결합니다. 이 코드 예제를 실행하려면 예제에 정의된 메서드가 button1(Button 컨트롤)과 checkBox1(CheckBox 컨트롤)이 포함된 Form 안에 있고 Form의 생성자에서 호출되어야 합니다.

' 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
// 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.
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.set_AutoPopDelay(5000);
    toolTip1.set_InitialDelay(1000);
    toolTip1.set_ReshowDelay(500);
    // Force the ToolTip text to be displayed whether or not the form
    // is active.
    toolTip1.set_ShowAlways(true);
    // Set up the ToolTip text for the Button and Checkbox.
    toolTip1.SetToolTip(this.button1, "My button1");
    toolTip1.SetToolTip(this.checkBox1, "My checkBox1");
} //Form1_Load

플랫폼

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

.NET Framework에서 모든 플래폼의 모든 버전을 지원하지는 않습니다. 지원되는 버전의 목록은 시스템 요구 사항을 참조하십시오.

버전 정보

.NET Framework

2.0, 1.1, 1.0에서 지원

참고 항목

참조

ToolTip 클래스
ToolTip 멤버
System.Windows.Forms 네임스페이스
UserControl
ToolTip.Active 속성
Show