Anyone know how to add the dropdown buttons that appear in toolbars to an ordinary form, or do I have to create my own?
Printable View
Anyone know how to add the dropdown buttons that appear in toolbars to an ordinary form, or do I have to create my own?
You simply display a ContextMenu when a Button is clicked.Code:private void button1_Click(object sender, System.EventArgs e)
{
this.contextMenu1.Show(this.button1, new Point(this.button1.Location.X, this.button1.Location.Y + this.button1.Height));
}
Thats pretty much what I ended up doing but I had two buttons one for clicking and one for popping up the menu.
If that's something you're likely to use more than once then you could make a UserControl.
That's what I'm doing because it's going to be part of a bigger UserControl