A
Alberto
Can I change by code the place where a ContextMenuStrip is placed when it's
opened?
Thank you
opened?
Thank you
Can I change by code the place where a ContextMenuStrip is placed when
it's opened?
I tried what you said but it doesn't work. First, in the mouse down event
handler, I get the e.x and e.y (the position of the pointer) and in the
event handler of the opening event, I change the ContexMenuStrip.Bound
property as this:
menu.Bound = new Rectangle(x, y, menu.Bound.Width, menu.Bound.Height);
Alberto said:I tried what you said but it doesn't work. First, in the mouse down
event handler, I get the e.x and e.y (the position of the pointer) and
in the event handler of the opening event, I change the
ContexMenuStrip.Bound property as this:
menu.Bound = new Rectangle(x, y, menu.Bound.Width, menu.Bound.Height);
The problem is that the context menu doesn't appear where the pointer is.
Alberto said:I agree with you that I should try to find out why the ContextMenu isn't
appearing in the default position but I don't know how to do it.
The situation is this: I have a control inherited from Panel who works
as a container but it's specialized with some methods and properties. In
this container I have controls inherited from Label who have a
ContexMenuStrip who are called "Nodo".
The first time I press the right button of the mouse over a "Nodo"
control, the menu appear with right x coordinate but with a wrong
coordinate Y (y=0). The sencond and next times I press the right button,
the menu appears in the right position.
It's very strange and I don't know how to trace it.
Alberto said:I agree with you that I should try to find out why the ContextMenu isn't
appearing in the default position but I don't know how to do it.
The situation is this: I have a control inherited from Panel who works
as a container but it's specialized with some methods and properties. In
this container I have controls inherited from Label who have a
ContexMenuStrip who are called "Nodo".
The first time I press the right button of the mouse over a "Nodo"
control, the menu appear with right x coordinate but with a wrong
coordinate Y (y=0). The sencond and next times I press the right button,
the menu appears in the right position.