Xceed Chart for WinForms v4.4 Documentation
Xceed.Chart.UIControls.v4.4 Assembly / Xceed.Chart.UIControls Namespace / ToolBar Class
Members Example


In This Topic
    ToolBar Class
    In This Topic
    Represents a toolbar-like control with flat appearance and support for custom drop-down controls. It provides all the functionality of the standard Windows.Forms.ToolBar as well as moving and changing location. This toolbar also provides some extended features as dropping custom PopupWindow objects instead of the standard ContextMenus.
    Object Model
    ToolBar Class
    Syntax
    'Declaration
     
    <DesignerAttribute(Xceed.Chart.UIControls.ToolBarDesigner)>
    <ToolboxItemAttribute(False)>
    <DefaultPropertyAttribute("Text")>
    <DefaultEventAttribute("Click")>
    <DesignerSerializerAttribute("System.Windows.Forms.Design.ControlCodeDomSerializer, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.ComponentModel.Design.Serialization.CodeDomSerializer, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")>
    <ToolboxItemFilterAttribute("System.Windows.Forms")>
    <DesignerCategoryAttribute("Component")>
    Public Class ToolBar 
       Inherits System.Windows.Forms.Control
    'Usage
     
    Dim instance As ToolBar
    [Designer(Xceed.Chart.UIControls.ToolBarDesigner)]
    [ToolboxItem(false)]
    [DefaultProperty("Text")]
    [DefaultEvent("Click")]
    [DesignerSerializer("System.Windows.Forms.Design.ControlCodeDomSerializer, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.ComponentModel.Design.Serialization.CodeDomSerializer, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
    [ToolboxItemFilter("System.Windows.Forms")]
    [DesignerCategory("Component")]
    public class ToolBar : System.Windows.Forms.Control 
    Remarks
    You may also add standard controls - they have to be assigned to a ToolBarButton object with its 'Style' property set to ToolBarButtonStyle.Control - to the toolbar and they will be repositioned and treated as if they are toolbar buttons.
    Example
    The following example demostrates how to add a combobox to an existing ToolBar object: This is useful because if you add the control directly to the toolbar you will be responsible for its proper location and size, while assigning it to a toolbar button guaranties you that.
    'create a toolbar
    Dim toolbar As ToolBar =  New ToolBar() 
    
    'create a toolbar button
    Dim tbb As ToolBarButton =  New ToolBarButton() 
    tbb.Style = ToolBarButtonStyle.Control
    
    'create a standard combobox
    Dim combo As ComboBox =  New ComboBox() 
    
    'assign it to the toolbar button
    tbb.Control = combo
    
    toolbar.Buttons.Add(tbb)
    //create a toolbar
    ToolBar toolbar = new ToolBar();
    
    //create a toolbar button
    ToolBarButton tbb = new ToolBarButton();
    tbb.Style = ToolBarButtonStyle.Control;
    
    //create a standard combobox
    ComboBox combo = new ComboBox();
    
    //assign it to the toolbar button
    tbb.Control = combo;
    
    toolbar.Buttons.Add(tbb);
    Inheritance Hierarchy

    System.Object
       System.MarshalByRefObject
          System.ComponentModel.Component
             System.Windows.Forms.Control
                Xceed.Chart.UIControls.ToolBar
                   Xceed.Chart.ChartToolbarControl

    Requirements

    Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

    See Also