Control.Focused 속성

정의

컨트롤에 입력 포커스가 있는지를 나타내는 값을 가져옵니다.

public:
 virtual property bool Focused { bool get(); };
[System.ComponentModel.Browsable(false)]
public virtual bool Focused { get; }
[<System.ComponentModel.Browsable(false)>]
member this.Focused : bool
Public Overridable ReadOnly Property Focused As Boolean

속성 값

Boolean

컨트롤에 포커스가 있으면 true이고, 그렇지 않으면 false입니다.

특성

예제

다음 코드 예제에서는 포커스가 없는 경우를 MenuItem TextBox 사용하지 않도록 설정합니다. 이 예제에서는 Form 명명된 개체와 TextBox 이름이 textBox1 menuItemEdit 지정된 두 개의 MenuItem 개체가 있어야 합니다menuItemEditInsertCustomerInfo.

private:
   void menuItemEdit_Popup( Object^ /*sender*/, EventArgs^ /*e*/ )
   {
      // Disable the menu item if the text box does not have focus.
      this->menuItemEditInsertCustomerInfo->Enabled = this->textBox1->Focused;
   }
private void menuItemEdit_Popup(object sender, EventArgs e)
{
   // Disable the menu item if the text box does not have focus.
   this.menuItemEditInsertCustomerInfo.Enabled = this.textBox1.Focused;
}
Private Sub menuItemEdit_Popup(sender As Object, _
  e As EventArgs) Handles menuItemEdit.Popup
   ' Disable the menu item if the text box does not have focus.
   Me.menuItemEditInsertCustomerInfo.Enabled = Me.textBox1.Focused
End Sub

상속자 참고

파생 클래스에서 Focused 속성을 재정의할 때 기본 클래스의 Focused 속성을 사용하여 기본 구현을 확장합니다. 그렇지 않으면 모든 구현을 제공해야 합니다.

적용 대상

추가 정보