views:

513

answers:

2

I want to show a ContextMenuStrip at the location of a ToolStripStatusLabel in a StatusStrip. Ordinary controls have PointToScreen / PointToClient / etc, but as ToolStripStatusLabel is derived from Component it does not.

Any help would be appreciated.

A: 

Can't you just do something like this:

int x = label.Bounds.Location.X + statusStrip.Location.X;
int y = label.Bounds.Location.Y + statusStrip.Location.Y;
menu.Show(this, x, y);
drs9222
A: 

Check out the Bounds property of the ToolStripStatusLabel. Use it like this to do what you need to do:

contextMenuStrip1.Show(statusStrip1, toolStripStatusLabel2.Bounds.X, toolStripStatusLabel2.Bounds.Y);
Jay Riggs