SpeakComputers.com online store
Electronics Software Computers Handhelds Laptops and Tablets Mobile Phones Digital Cameras Camcorders Games Music Books Sport Mens and Womens Watches Power Tools Household appliances

PRODUCTS

Software Downloads 2012 Software Mac Software Security Student Editions Windows 7 Office 2010

ContextMenuBar, DevComponents.

The ContextMenuBar replaces the windows forms contextmenu.

Namespace: DevComponents.DotNetBar
Assembly: DevComponents.DotNetBar2.dll
Using: DevComponents.DotNetBar.Controls;
Declaring: DevComponents.DotNetBar.ContextMenuBar();

Creating the ContextMenuBar and ButtonItems for the ContextMenuBar and assigning it to the windows form.

DevComponents.DotNetBar.ContextMenuBar contextmenu = new DevComponents.DotNetBar.ContextMenuBar();
contextmenu.Style = DevComponents.DotNetBar.eDotNetBarStyle.Office2007;
contextmenu.Size = new Size(75, 23);
DevComponents.DotNetBar.ButtonItem contextbutton1 = new DevComponents.DotNetBar.ButtonItem();
contextbutton1.Text = "ContextMenu";
DevComponents.DotNetBar.ButtonItem contextbutton2 = new DevComponents.DotNetBar.ButtonItem();
contextbutton2.Text = "Open";
contextbutton1.SubItems.Add(contextbutton2);
DevComponents.DotNetBar.ButtonItem contextbutton3 = new DevComponents.DotNetBar.ButtonItem();
contextbutton3.Text = "Close";
contextbutton1.SubItems.Add(contextbutton3);
contextmenu.SetContextMenuEx(this, contextbutton1);

Creating a button click event for the DevComponents.DotNetBar.ButtonItem within the ContextMenuBar.

contextbutton2.Click += new EventHandler(contextbutton2_Click);

Responding tot the click event.

void contextbutton2_Click(object sender, EventArgs e)
{
DevComponents.DotNetBar.ButtonItem selectedbutton = (DevComponents.DotNetBar.ButtonItem)sender;
MessageBox.Show(selectedbutton.Text);
}

Screenshots - ContextMenuBar, DevComponents.

ContextMenuBar examples from the DevComponents Windows Forms Programming control set.
Home About Privacy Policy Resouces Search

Copy Right 2006 SpeakComputers.com - All Rights Reserved.