ToolStripDropDownButton.ShowDropDownArrow 속성
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
드롭다운 목록에 하위 옵션이 있음을 나타내는 화살표를 ToolStripDropDownButton에 표시할지 여부를 나타내는 값을 가져오거나 설정합니다.
public:
property bool ShowDropDownArrow { bool get(); void set(bool value); };
public bool ShowDropDownArrow { get; set; }
member this.ShowDropDownArrow : bool with get, set
Public Property ShowDropDownArrow As Boolean
속성 값
ToolStripDropDownButton에 화살표를 표시하면 true
이고, 그렇지 않으면 false
입니다. 기본값은 true
입니다.
예제
다음 코드 예제에서는 컨트롤을 ToolStripDropDownButton 만들고 초기화합니다. ShowDropDownArrow 속성이 false
로 설정되어 있습니다.
// Declare the drop-down button and the items it will contain.
ToolStripDropDownButton^ dropDownButton1;
ToolStripDropDown^ dropDown;
ToolStripButton^ buttonRed;
ToolStripButton^ buttonBlue;
ToolStripButton^ buttonYellow;
void InitializeDropDownButton()
{
dropDownButton1 = gcnew ToolStripDropDownButton;
dropDown = gcnew ToolStripDropDown;
dropDownButton1->Text = "A";
// Set the drop-down on the DropDownButton.
dropDownButton1->DropDown = dropDown;
// Declare three buttons, set their forecolor and text,
// and add the buttons to the drop-down.
buttonRed = gcnew ToolStripButton;
buttonRed->ForeColor = Color::Red;
buttonRed->Text = "A";
buttonBlue = gcnew ToolStripButton;
buttonBlue->ForeColor = Color::Blue;
buttonBlue->Text = "A";
buttonYellow = gcnew ToolStripButton;
buttonYellow->ForeColor = Color::Yellow;
buttonYellow->Text = "A";
buttonBlue->Click += gcnew EventHandler(this,
&Form1::colorButtonsClick);
buttonRed->Click += gcnew EventHandler(this,
&Form1::colorButtonsClick);
buttonYellow->Click += gcnew EventHandler(this,
&Form1::colorButtonsClick);
array<ToolStripItem^>^ ToolStrips =
{buttonRed,buttonBlue,buttonYellow};
dropDown->Items->AddRange(ToolStrips);
toolStrip1->Items->Add(dropDownButton1);
}
// Handle the buttons' click event by setting the forecolor
// of the form to the forecolor of the button that is clicked.
void colorButtonsClick(Object^ sender, EventArgs^ e)
{
ToolStripButton^ senderButton = (ToolStripButton^) sender;
this->ForeColor = senderButton->ForeColor;
}
// internal:
// Declare the drop-down button and the items it will contain.
internal ToolStripDropDownButton dropDownButton1;
internal ToolStripDropDown dropDown;
internal ToolStripButton buttonRed;
internal ToolStripButton buttonBlue;
internal ToolStripButton buttonYellow;
private void InitializeDropDownButton()
{
dropDownButton1 = new ToolStripDropDownButton();
dropDown = new ToolStripDropDown();
dropDownButton1.Text = "A";
// Set the drop-down on the ToolStripDropDownButton.
dropDownButton1.DropDown = dropDown;
// Set the drop-down direction.
dropDownButton1.DropDownDirection = ToolStripDropDownDirection.Left;
// Do not show a drop-down arrow.
dropDownButton1.ShowDropDownArrow = false;
// Declare three buttons, set their foreground color and text,
// and add the buttons to the drop-down.
buttonRed = new ToolStripButton();
buttonRed.ForeColor = Color.Red;
buttonRed.Text = "A";
buttonBlue = new ToolStripButton();
buttonBlue.ForeColor = Color.Blue;
buttonBlue.Text = "A";
buttonYellow = new ToolStripButton();
buttonYellow.ForeColor = Color.Yellow;
buttonYellow.Text = "A";
buttonBlue.Click += new EventHandler(colorButtonsClick);
buttonRed.Click += new EventHandler(colorButtonsClick);
buttonYellow.Click += new EventHandler(colorButtonsClick);
dropDown.Items.AddRange(new ToolStripItem[]
{ buttonRed, buttonBlue, buttonYellow });
toolStrip1.Items.Add(dropDownButton1);
}
// Handle the buttons' click event by setting the foreground color of the
// form to the foreground color of the button that is clicked.
private void colorButtonsClick(object sender, EventArgs e)
{
ToolStripButton senderButton = (ToolStripButton)sender;
this.ForeColor = senderButton.ForeColor;
}
' Declare the drop-down button and the items it will contain.
Friend WithEvents dropDownButton1 As ToolStripDropDownButton
Friend WithEvents dropDown As ToolStripDropDown
Friend WithEvents buttonRed As ToolStripButton
Friend WithEvents buttonBlue As ToolStripButton
Friend WithEvents buttonYellow As ToolStripButton
Private Sub InitializeDropDownButton()
dropDownButton1 = New ToolStripDropDownButton()
dropDown = New ToolStripDropDown()
dropDownButton1.Text = "A"
' Set the drop-down on the ToolStripDropDownButton.
dropDownButton1.DropDown = dropDown
' Set the drop-down direction.
dropDownButton1.DropDownDirection = ToolStripDropDownDirection.Left
' Do not show a drop-down arrow.
dropDownButton1.ShowDropDownArrow = False
' Declare three buttons, set their foreground color and text,
' and add the buttons to the drop-down.
buttonRed = New ToolStripButton()
buttonRed.ForeColor = Color.Red
buttonRed.Text = "A"
buttonBlue = New ToolStripButton()
buttonBlue.ForeColor = Color.Blue
buttonBlue.Text = "A"
buttonYellow = New ToolStripButton()
buttonYellow.ForeColor = Color.Yellow
buttonYellow.Text = "A"
dropDown.Items.AddRange(New ToolStripItem() {buttonRed, buttonBlue, buttonYellow})
toolStrip1.Items.Add(dropDownButton1)
End Sub
' Handle the buttons' click event by setting the foreground color of the
' form to the foreground color of the button that is clicked.
Public Sub colorButtonsClick(ByVal sender As [Object], ByVal e As EventArgs) _
Handles buttonRed.Click, buttonBlue.Click, buttonYellow.Click
Dim senderButton As ToolStripButton = CType(sender, ToolStripButton)
Me.ForeColor = senderButton.ForeColor
End Sub