Control.CanFocus 속성

정의

컨트롤이 포커스를 받을 수 있는지 여부를 나타내는 값을 가져옵니다.

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

속성 값

컨트롤이 포커스를 받을 수 있으면

특성

예제

다음은 포커스를 받을 수 있는 경우 지정된 포커스로 Control포커스를 설정하는 코드 예제입니다.

public:
   void ControlSetFocus( Control^ control )
   {
      
      // Set focus to the control, if it can receive focus.
      if ( control->CanFocus )
      {
         control->Focus();
      }
   }
public void ControlSetFocus(Control control)
{
   // Set focus to the control, if it can receive focus.
   if(control.CanFocus)
   {
      control.Focus();
   }
}
Public Sub ControlSetFocus(control As Control)
   ' Set focus to the control, if it can receive focus.
   If control.CanFocus Then
      control.Focus()
   End If
End Sub

설명

컨트롤이 입력 포커스를 받으려면 컨트롤에 할당된 핸들이 있어야 하며 컨트롤과 VisibleEnabled 해당 부모 컨트롤 모두에 대해 컨트롤 및 속성이 모두 설정 true 되어야 하며 컨트롤이 폼이거나 컨트롤의 가장 바깥쪽 부모가 폼이어야 합니다.

적용 대상

추가 정보