SplitContainer.TabStop 속성

정의

Tab 키를 사용하여 분할자에 포커스를 지정할 수 있는지 여부를 나타내는 값을 가져오거나 설정합니다.

public:
 property bool TabStop { bool get(); void set(bool value); };
public bool TabStop { get; set; }
member this.TabStop : bool with get, set
Public Property TabStop As Boolean

속성 값

Boolean

Tab 키를 사용하여 분할자에 포커스를 지정할 수 있으면 true이고, 그렇지 않으면 false입니다. 기본값은 true입니다.

설명

사용자가 TAB 키를 누르면 입력 포커스가 폼의 탭 순서로 다음 컨트롤로 설정됩니다. true 화살표 키와 마우스를 사용하여 이동할 수 있도록 스플리터에 입력 포커스를 지정하도록 설정합니다TabStop. .NET Framework 4부터 분할자 및 탭 순서의 컨트롤 컬렉션에 SplitContainer 포함된 컨트롤을 제외하도록 false 설정합니다TabStop. TAB 키를 사용하여 컨트롤이 포커스를 가져올 수 있도록 하려면 .에서 SplitContainer상속하는 컨트롤을 만듭니다. 명명 TabStop 된 새 속성을 만들고 메서드를 재정의합니다 ProcessTabKey . 다음 예제에서는 이 작업을 수행하는 방법을 보여 줍니다.

public class MySplitContainer : SplitContainer
{
    private bool tabStop = true;
    public new bool TabStop
    {
        get
        {
            return tabStop;
        }
        set
        {
            if (TabStop != value)
            {
                tabStop = value;
                OnTabStopChanged(EventArgs.Empty);
            }
        }
    }

    protected override bool ProcessTabKey(bool forward)
    {
        if (!tabStop)
        {
            if (SelectNextControl(ActiveControl, forward, true, true, false)) return true;
        }
        return base.ProcessTabKey(forward);
    }
}
Public Class MySplitContainer
    Inherits SplitContainer
    Private m_tabStop As Boolean = True
    Public Shadows Property TabStop() As Boolean
        Get
            Return m_tabStop
        End Get
        Set(ByVal value As Boolean)
            If TabStop <> value Then
                m_tabStop = value
                OnTabStopChanged(EventArgs.Empty)
            End If
        End Set
    End Property

    Protected Overloads Overrides Function ProcessTabKey(ByVal forward As Boolean) As Boolean
        If Not m_tabStop Then
            If SelectNextControl(ActiveControl, forward, True, True, False) Then
                Return True
            End If
        End If
        Return MyBase.ProcessTabKey(forward)
    End Function
End Class

컨트롤의 TabIndex 속성 값을 설정하여 탭 순서를 조작할 수 있습니다.

적용 대상

추가 정보