ToolBar.Appearance 속성

정의

ToolBar 컨트롤 및 해당 단추의 모양을 결정하는 값을 가져오거나 설정합니다.

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

속성 값

ToolBarAppearance 값 중 하나입니다. 기본값은 ToolBarAppearance.Normal입니다.

예외

할당된 값이 ToolBarAppearance 값 중 하나가 아닌 경우

예제

다음 코드 예제에서는 컨트롤을 ToolBar 만들고, 해당 공통 속성 중 일부를 설정하고, 에 Form추가합니다. 대리자에 추가 됩니다는 ButtonClickButtonDropDown 이벤트입니다. 이 예제에서는 명명 toolBar1ToolBar 및 명명된 를 ImageListimageList1 선언해야 합니다.

void AddToolBar()
{
   
   // Add a toolbar and set some of its properties.
   toolBar1 = gcnew ToolBar;
   toolBar1->Appearance = System::Windows::Forms::ToolBarAppearance::Flat;
   toolBar1->BorderStyle = System::Windows::Forms::BorderStyle::None;
   toolBar1->Buttons->Add( this->toolBarButton1 );
   toolBar1->ButtonSize = System::Drawing::Size( 24, 24 );
   toolBar1->Divider = true;
   toolBar1->DropDownArrows = true;
   toolBar1->ImageList = this->imageList1;
   toolBar1->ShowToolTips = true;
   toolBar1->Size = System::Drawing::Size( 292, 25 );
   toolBar1->TabIndex = 0;
   toolBar1->TextAlign = System::Windows::Forms::ToolBarTextAlign::Right;
   toolBar1->Wrappable = false;
   
   // Add handlers for the ButtonClick and ButtonDropDown events.
   toolBar1->ButtonDropDown += gcnew ToolBarButtonClickEventHandler( this, &MyToolBar::toolBar1_ButtonDropDown );
   toolBar1->ButtonClick += gcnew ToolBarButtonClickEventHandler( this, &MyToolBar::toolBar1_ButtonClicked );
   
   // Add the toolbar to the form.
   this->Controls->Add( toolBar1 );
}
private void AddToolBar()
{
   // Add a toolbar and set some of its properties.
   toolBar1 = new ToolBar();
   toolBar1.Appearance = System.Windows.Forms.ToolBarAppearance.Flat;
   toolBar1.BorderStyle = System.Windows.Forms.BorderStyle.None;
   toolBar1.Buttons.Add(this.toolBarButton1);
   toolBar1.ButtonSize = new System.Drawing.Size(24, 24);
   toolBar1.Divider = true;
   toolBar1.DropDownArrows = true;
   toolBar1.ImageList = this.imageList1;
   toolBar1.ShowToolTips = true;
   toolBar1.Size = new System.Drawing.Size(292, 25);
   toolBar1.TabIndex = 0;
   toolBar1.TextAlign = System.Windows.Forms.ToolBarTextAlign.Right;
   toolBar1.Wrappable = false;
   
   // Add handlers for the ButtonClick and ButtonDropDown events.
   toolBar1.ButtonDropDown += 
     new ToolBarButtonClickEventHandler(toolBar1_ButtonDropDown);
   toolBar1.ButtonClick += 
     new ToolBarButtonClickEventHandler(toolBar1_ButtonClicked);

   // Add the toolbar to the form.
   this.Controls.Add(toolBar1);
}
Private Sub AddToolBar()
   ' Add a toolbar and set some of its properties.
   toolBar1 = New ToolBar()
   toolBar1.Appearance = System.Windows.Forms.ToolBarAppearance.Flat
   toolBar1.BorderStyle = System.Windows.Forms.BorderStyle.None
   toolBar1.Buttons.Add(Me.toolBarButton1)
   toolBar1.ButtonSize = New System.Drawing.Size(24, 24)
   toolBar1.Divider = True
   toolBar1.DropDownArrows = True
   toolBar1.ImageList = Me.imageList1
   toolBar1.ShowToolTips = True
   toolBar1.Size = New System.Drawing.Size(292, 25)
   toolBar1.TabIndex = 0
   toolBar1.TextAlign = System.Windows.Forms.ToolBarTextAlign.Right
   toolBar1.Wrappable = False

   ' Add handlers for the ButtonClick and ButtonDropDown events.
   AddHandler toolBar1.ButtonDropDown, AddressOf toolBar1_ButtonDropDown
   AddHandler toolBar1.ButtonClick, AddressOf toolBar1_ButtonClicked

   ' Add the toolbar to the form.
   Me.Controls.Add(toolBar1)
End Sub

설명

속성은 Appearance 도구 모음에 할당된 단추의 모양에 영향을 줍니다. 모양이 로 설정 ToolBarAppearance.Normal되면 도구 모음의 단추가 3차원으로 나타나고 발생합니다. Appearance 도구 모음의 속성을 로 설정하여 도구 모음 ToolBarAppearance.Flat 의 단추에 평평한 모양을 지정합니다. 마우스 포인터가 평평한 단추 위로 이동하면 3차원으로 나타납니다. 속성이 설정된 FlatToolBarAppearance 구분 기호는 발생된 단추 사이의 공백이 아닌 에칭된 선으로 표시됩니다. 평면 스타일 단추는 애플리케이션 웹과 비슷한 확인을 제공합니다.

적용 대상

추가 정보