See following code for sample implementation. Also review the BarFromCode sample shipped with DotNetBar for working sample and full source code.

VB:

Imports DevComponents.DotNetBar
        .
        .
        .
        ' Create a new Bar
        Dim bar As Bar = New Bar("Standard")
        bar.GrabHandleStyle = eGrabHandleStyle.StripeFlat
        m_DotNetBar.Bars.Add(bar)
        bar.DockSide = eDockSide.Top
 
        ' Add Items to it
        Dim item, subItem As ButtonItem
        ' New
        item = New ButtonItem("bNew","&New")
        item.PopupType=ePopupType.Menu ' This determines drop-down type
        bar.Items.Add(item)
        ' Now add sub-items to it
        subItem=new ButtonItem("bSubitem1","Sub-item 1")
        item.SubItems.Add(subItem)
        subItem=new ButtonItem("bSubitem2","Sub-item 2")
        item.SubItems.Add(subItem)
        .
        .
        .

C#:

using DevComponents.DotNetBar;
         .
         .
         .
         // Create a new Bar
         Bar bar=new Bar("Standard");
         m_DotNetBar.Bars.Add(bar)
         bar.DockSide=eDockSide.Top;
 
         // Add Items to it
         ButtonItem item, subItem;
         // New
         item=new ButtonItem("bNew","&New");	
         item.PopupType=ePopupType.ToolBar; // This determines drop-down type
         bar.Items.Add(item);	
         // Now add sub-items to it
         subItem=new ButtonItem("bSubitem1","Sub-item 1");
         item.SubItems.Add(subItem);
         subItem=new ButtonItem("bSubitem2","Sub-item 2");
         item.SubItems.Add(subItem);
         .
         .
         .

Related posts:

  1. How to Create Toolbars Using Code
  2. How to Create Menu Using Code
  3. How to create Excel like popup border toolbar
  4. How to Create Context Menus
  5. How to display any control on popup