drop down menu on button click

V

vicky

i want to show drop down menu when a button is clicked,how
can i do this. Is there any property of button for this or
any other control is to be usd

thanks
 
X

Xian

.....
private Button btn;
private ContextMenu contextMenu;
....


private void btn_Click(object sender, System.EventArgs e)
{
contextMenu.Show(this,new Point(btn.Left,btn.Bottom));
}

Somethink like this?
 
J

Jeff Gaines

....
private Button btn;
private ContextMenu contextMenu;
...


private void btn_Click(object sender, System.EventArgs e)
{
contextMenu.Show(this,new Point(btn.Left,btn.Bottom));
}

Somethink like this?

You may need to use ClientRectangle to get the Context Menu in
the right place:

private void btnTools_Click(object sender, System.EventArgs e)
{
Point pt = new Point(btnTools.ClientRectangle.Left,
btnTools.ClientRectangle.Bottom);
ctxControl.Show(btnTools, pt);
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top