drop down menu on button click

  • Thread starter Thread starter vicky
  • Start date Start date
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
 
.....
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?
 
....
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);
}
 
Back
Top