DevComponents.com

How to create menu side-bar

Assigning the menu side-bar is done through the code by setting the PopUpSideBar property of your item to desired side-bar structure.

Follow these steps to create image side-bar for an popup menu:

  1. Create your menu as usual using DotNetBar designer or code
  2. In the form that is hosting DotNetBarManager add new Form.Load event handler
  3. Get the reference to the item that is parent of your popup menu
  4. Assign to the PopUpSideBar property new instance of the SideBarImage structure that describes your side-bar

Following code is taken from Popup sample that shows how to assign the side-bar image to an popup menu:

      VB
.
.
.
' Setup side-bar, make sure that image that is used fits, or exceeds the height
' Side-bar will be displayed only for popup menus
Dim si As DevComponents.DotNetBar.SideBarImage
si = New DevComponents.DotNetBar.SideBarImage()
si.Picture = New Bitmap(Me.GetType(), "devco.jpg")
' If image exceeds the size of the popup menu this specifies the image alignment
si.Alignment = DevComponents.DotNetBar.eAlignment.Bottom
' If there is no image specified gradient can be used
si.GradientColor1 = Color.Orange
si.GradientColor2 = Color.Black
myParentPopupItem.PopUpSideBar = si
.
.
.
      C#
.
.
.
// Setup side-bar, make sure that image that is used fits, or exceeds the height
// Side-bar will be displayed only for popup menus
DevComponents.DotNetBar.SideBarImage si=new DevComponents.DotNetBar.SideBarImage();
si.Picture=new Bitmap(typeof(Popup.Form1),"devco.jpg");
// If image exceeds the size of the popup menu this specifies the image alignment
si.Alignment=DevComponents.DotNetBar.eAlignment.Bottom;
// If there is no image specified gradient can be used
si.GradientColor1=Color.Orange;
si.GradientColor2=Color.Black;
myParentPopupItem.PopUpSideBar=si;

You can find working example of menu side-bar and associated code in Popup sample.

 

Would you like to...

Print this page Print this page

Email this page Email this page

Post a comment Post a comment

Subscribe me

Add to favoritesAdd to favorites

User Opinions (4 votes)

100% thumbs up 0% thumbs down

How would you rate this answer?

Helpful
Not helpful
Thank you for rating this answer.

Related Questions

No related questions were found.

Attachments

No attachments were found.