ToolStripItem.Overflow 속성

정의

항목이 ToolStrip이나 ToolStripOverflowButton에 연결되었는지 아니면 둘 사이에 부동 상태로 있을 수 있는지 나타내는 값을 가져오거나 설정합니다.Gets or sets whether the item is attached to the ToolStrip or ToolStripOverflowButton or can float between the two.

public:
 property System::Windows::Forms::ToolStripItemOverflow Overflow { System::Windows::Forms::ToolStripItemOverflow get(); void set(System::Windows::Forms::ToolStripItemOverflow value); };
public System.Windows.Forms.ToolStripItemOverflow Overflow { get; set; }
member this.Overflow : System.Windows.Forms.ToolStripItemOverflow with get, set
Public Property Overflow As ToolStripItemOverflow

속성 값

ToolStripItemOverflow 값 중 하나입니다.One of the ToolStripItemOverflow values. 기본값은 AsNeeded입니다.The default is AsNeeded.

예외

할당된 값이 ToolStripItemOverflow 값 중 하나가 아닌 경우The value assigned is not one of the ToolStripItemOverflow values.

예제

다음 코드 예제에서는 설정 하는 방법에 설명 합니다 Text, Overflow, 및 TextDirection 속성 및 처리를 Click 이벤트.The following code example demonstrates how to set the Text, Overflow, and TextDirection properties, and handle the Click event. 이 예제를 실행 하려면 다음 코드를 포함 하는 형식으로 붙여넣습니다를 ToolStrip 라는 movingToolStrip 호출 InitializeMovingToolStrip 폼의 생성자에서 또는 Load 이벤트 처리기입니다.To run this example, paste the following code into a form that contains a ToolStrip named movingToolStrip and call InitializeMovingToolStrip in the form's constructor or Load event handler.

ToolStripButton^ changeDirectionButton;

void InitializeMovingToolStrip()
{
    changeDirectionButton = gcnew ToolStripButton;
    movingToolStrip->AutoSize = true;
    movingToolStrip->RenderMode = ToolStripRenderMode::System;
    changeDirectionButton->TextDirection = 
        ToolStripTextDirection::Vertical270;
    changeDirectionButton->Overflow = 
        ToolStripItemOverflow::Never;
    changeDirectionButton->Text = "Change Alignment";
    movingToolStrip->Items->Add(changeDirectionButton);
    changeDirectionButton->Click += gcnew EventHandler(this, 
        &Form1::changeDirectionButtonClick);
}

void changeDirectionButtonClick(Object^ sender, EventArgs^ e)
{
    ToolStripItem^ item = (ToolStripItem^) sender;
    if ((item->TextDirection == ToolStripTextDirection::Vertical270) 
        || (item->TextDirection == ToolStripTextDirection::Vertical90))
    {
        item->TextDirection = ToolStripTextDirection::Horizontal;
        movingToolStrip->Raft = RaftingSides::Top;
    }
    else
    {
        item->TextDirection = 
            ToolStripTextDirection::Vertical270;
        movingToolStrip->Raft = RaftingSides::Left;
    }
}


internal ToolStripButton changeDirectionButton;

private void InitializeMovingToolStrip()
{
    movingToolStrip = new ToolStrip();

    changeDirectionButton = new ToolStripButton();

    movingToolStrip.AutoSize = true;
    movingToolStrip.RenderMode = ToolStripRenderMode.System;

    changeDirectionButton.TextDirection = ToolStripTextDirection.Vertical270;
    changeDirectionButton.Overflow = ToolStripItemOverflow.Never;
    changeDirectionButton.Text = "Change Alignment";
        movingToolStrip.Items.Add(changeDirectionButton);
}


private void changeDirectionButton_Click(object sender, EventArgs e)
{

    ToolStripItem item = (ToolStripItem)sender;

    if (item.TextDirection == ToolStripTextDirection.Vertical270 || item.TextDirection == ToolStripTextDirection.Vertical90)
    {
        item.TextDirection = ToolStripTextDirection.Horizontal;
        movingToolStrip.Dock = System.Windows.Forms.DockStyle.Top;
    }
    else
    {
        item.TextDirection = ToolStripTextDirection.Vertical270;
        movingToolStrip.Dock = System.Windows.Forms.DockStyle.Left;
    }

}
Friend WithEvents changeDirectionButton As ToolStripButton

Private Sub InitializeMovingToolStrip()
    changeDirectionButton = New ToolStripButton()

    movingToolStrip.AutoSize = True
    movingToolStrip.RenderMode = ToolStripRenderMode.System

    changeDirectionButton.TextDirection = ToolStripTextDirection.Vertical270
    changeDirectionButton.Overflow = ToolStripItemOverflow.Never
    changeDirectionButton.Text = "Change Alignment"
    movingToolStrip.Items.Add(changeDirectionButton)
End Sub


Public Sub changeDirectionButton_Click(ByVal sender As Object, _
    ByVal e As EventArgs) Handles changeDirectionButton.Click

    Dim item As ToolStripItem = CType(sender, ToolStripItem)

    If item.TextDirection = ToolStripTextDirection.Vertical270 _
        OrElse item.TextDirection = ToolStripTextDirection.Vertical90 Then

        item.TextDirection = ToolStripTextDirection.Horizontal
        movingToolStrip.Dock = System.Windows.Forms.DockStyle.Top
    Else
        item.TextDirection = ToolStripTextDirection.Vertical270
        movingToolStrip.Dock = System.Windows.Forms.DockStyle.Left
    End If

End Sub

설명

사용 된 Overflow 스택 레이아웃의 속성입니다.Use the Overflow property in stack layouts. 흐름 및 테이블 레이아웃에는 ToolStrip 오버플로 단추가 렌더링 되지 않습니다 및는 Overflow 속성은 무시 됩니다.In flow and table layouts, the ToolStrip overflow button is not rendered, and therefore the Overflow property is ignored.

적용 대상