ToolBarButtonStyle ToolBarButtonStyle ToolBarButtonStyle ToolBarButtonStyle Enum

정의

도구 모음 내의 단추 스타일을 지정합니다.Specifies the button style within a toolbar.

public enum class ToolBarButtonStyle
public enum ToolBarButtonStyle
type ToolBarButtonStyle = 
Public Enum ToolBarButtonStyle
상속
ToolBarButtonStyleToolBarButtonStyleToolBarButtonStyleToolBarButtonStyle

필드

DropDownButton DropDownButton DropDownButton DropDownButton 4

클릭할 때 메뉴 또는 다른 창을 표시하는 드롭다운 컨트롤입니다.A drop-down control that displays a menu or other window when clicked.

PushButton PushButton PushButton PushButton 1

표준 3차원 단추입니다.A standard, three-dimensional button.

Separator Separator Separator Separator 3

도구 모음 단추 사이의 공간 또는 선입니다.A space or line between toolbar buttons. 이 모양은 Appearance 속성의 값에 따라 다릅니다.The appearance depends on the value of the Appearance property.

ToggleButton ToggleButton ToggleButton ToggleButton 2

클릭하면 오목하게 표시되어 다시 클릭할 때까지 오목한 상태를 유지하는 토글 단추입니다.A toggle button that appears sunken when clicked and retains the sunken appearance until clicked again.

예제

다음 예제에서는 한 ToolBar 및 3 ToolBarButton 제어 단추 도구 모음에 할당 하 고 단추의 공용 속성 중 일부를 설정 합니다.The following example instantiates a ToolBar and three ToolBarButton controls, assigns the buttons to the toolbar, and sets some of the buttons' common properties. 이 코드를 MenuItem, ImageList, ToolTipForm 인스턴스화된 및 ImageList 에 하나 이상의 Image 할당 합니다.This code assumes a MenuItem, ImageList, ToolTip and a Form have been instantiated and the ImageList has at least one Image assigned to it.

public:
   void InitializeMyToolBar()
   {
      // Create the ToolBar, ToolBarButton controls, and menus.
      ToolBarButton^ toolBarButton1 = gcnew ToolBarButton( "Open" );
      ToolBarButton^ toolBarButton2 = gcnew ToolBarButton;
      ToolBarButton^ toolBarButton3 = gcnew ToolBarButton;
      ToolBar^ toolBar1 = gcnew ToolBar;
      MenuItem^ menuItem1 = gcnew MenuItem( "Print" );
      array<MenuItem^>^ temp1 = {menuItem1};
      System::Windows::Forms::ContextMenu^ contextMenu1 =
         gcnew System::Windows::Forms::ContextMenu( temp1 );
      
      // Add the ToolBarButton controls to the ToolBar.
      toolBar1->Buttons->Add( toolBarButton1 );
      toolBar1->Buttons->Add( toolBarButton2 );
      toolBar1->Buttons->Add( toolBarButton3 );
      
      // Assign an ImageList to the ToolBar and show ToolTips.
      toolBar1->ImageList = imageList1;
      toolBar1->ShowToolTips = true;
      
      /* Assign ImageIndex, ContextMenu, Text, ToolTip, and 
         Style properties of the ToolBarButton controls. */
      toolBarButton2->Style = ToolBarButtonStyle::Separator;
      toolBarButton3->Text = "Print";
      toolBarButton3->Style = ToolBarButtonStyle::DropDownButton;
      toolBarButton3->ToolTipText = "Print";
      toolBarButton3->ImageIndex = 0;
      toolBarButton3->DropDownMenu = contextMenu1;
      
      // Add the ToolBar to a form.
      Controls->Add( toolBar1 );
   }
public void InitializeMyToolBar()
 {
    // Create the ToolBar, ToolBarButton controls, and menus.
    ToolBarButton toolBarButton1 = new ToolBarButton("Open");
    ToolBarButton toolBarButton2 = new ToolBarButton();
    ToolBarButton toolBarButton3 = new ToolBarButton();
    ToolBar toolBar1 = new ToolBar();
    MenuItem menuItem1 = new MenuItem("Print");
    ContextMenu contextMenu1 = new ContextMenu(new MenuItem[]{menuItem1});

     
    // Add the ToolBarButton controls to the ToolBar.
    toolBar1.Buttons.Add(toolBarButton1);
    toolBar1.Buttons.Add(toolBarButton2);
    toolBar1.Buttons.Add(toolBarButton3);
 
    // Assign an ImageList to the ToolBar and show ToolTips.
    toolBar1.ImageList = imageList1;
    toolBar1.ShowToolTips = true;
 
    /* Assign ImageIndex, ContextMenu, Text, ToolTip, and 
       Style properties of the ToolBarButton controls. */
    toolBarButton2.Style = ToolBarButtonStyle.Separator;
    toolBarButton3.Text = "Print";
    toolBarButton3.Style = ToolBarButtonStyle.DropDownButton;
    toolBarButton3.ToolTipText = "Print";
    toolBarButton3.ImageIndex = 0;
    toolBarButton3.DropDownMenu = contextMenu1;
 
    // Add the ToolBar to a form.
    Controls.Add(toolBar1);
 }
 
Public Sub InitializeMyToolBar()
    ' Create the ToolBar, ToolBarButton controls, and menus.
    Dim toolBarButton1 As New ToolBarButton("Open")
    Dim toolBarButton2 As New ToolBarButton()
    Dim toolBarButton3 As New ToolBarButton()
    Dim toolBar1 As New ToolBar()
Dim menuItem1 As New MenuItem("Print")
Dim contextMenu1 As New ContextMenu(New MenuItem(){menuItem1})
    
    ' Add the ToolBarButton controls to the ToolBar.
    toolBar1.Buttons.Add(toolBarButton1)
    toolBar1.Buttons.Add(toolBarButton2)
    toolBar1.Buttons.Add(toolBarButton3)
    
    ' Assign an ImageList to the ToolBar and show ToolTips.
    toolBar1.ImageList = imageList1
    toolBar1.ShowToolTips = True
    
    ' Assign ImageIndex, ContextMenu, Text, ToolTip, and
    ' Style properties of the ToolBarButton controls. 
    toolBarButton2.Style = ToolBarButtonStyle.Separator
    toolBarButton3.Text = "Print"
    toolBarButton3.Style = ToolBarButtonStyle.DropDownButton
    toolBarButton3.ToolTipText = "Print"
    toolBarButton3.ImageIndex = 0
    toolBarButton3.DropDownMenu = contextMenu1
    
    ' Add the ToolBar to a form.
    Controls.Add(toolBar1)
End Sub

설명

이 열거형 멤버와 같은 사용은 ToolBarButton.Style합니다.This enumeration is used by members such as ToolBarButton.Style.

도구 모음 단추 모양을 도달한는 Appearance 도구 모음의 속성입니다.The toolbar button appearance is determined by the Appearance property of the toolbar. 설정 된 Appearance 속성을 Flat 나옴 도구 모음 및 해당 단추를 평면 모양으로 표시 합니다.Setting the Appearance property to Flat will give the toolbar and its buttons a flat appearance. 마우스 포인터를 단추 위로 이동, 3 차원 모양에 수행 합니다.As the mouse pointer moves over the buttons, they take on a three-dimensional appearance. 또한 도구 모음을 평면 모양으로 표시 면 단추 구분 기호 단추 사이의 공간이 아니라 선으로 나타납니다.Also, when the toolbar has a flat appearance, button separators appear as a line rather than as a space between the buttons.

적용 대상

추가 정보