cyberjunk
03-09-2012 22:52:03
Hey there,
I'm using Miyagi Panel class and I've set "Movable = true" and I can move the Panel around. Fine so far.
However, once I add a Label (TextBox, Button, ...) I can not trigger the Panel moving by holding down the button on such a sub control.
Of course: The events get consumed by the SubControl...
My question:
How can I make a Panel movable even if the "mousedown/mousemove/..." events are catched by the subcontrol? (e.g. Label).
I want the Panel to move no matter which subcontrol the mouse actually is on.
I tried to add a event listener to all Mouse and Drag events the Label (subcontrol) offers.
Then calling corresponding event handlers on the Panel class, like:
I also tried with the Label itself as "dragSource" (3. argument), just passed e to handler.
And I've added any Mouse/Drag event like the example above.
Still not working. No panel move if the mouse is not exactly on the panel (without a subcontrol).
Any solution?
I bet there is something simple I'm just missing.
Thank you
I'm using Miyagi Panel class and I've set "Movable = true" and I can move the Panel around. Fine so far.
However, once I add a Label (TextBox, Button, ...) I can not trigger the Panel moving by holding down the button on such a sub control.
Of course: The events get consumed by the SubControl...
My question:
How can I make a Panel movable even if the "mousedown/mousemove/..." events are catched by the subcontrol? (e.g. Label).
I want the Panel to move no matter which subcontrol the mouse actually is on.
I tried to add a event listener to all Mouse and Drag events the Label (subcontrol) offers.
Then calling corresponding event handlers on the Panel class, like:
lblTitle.DragOver += new EventHandler<DragEventArgs>(lblTitle_DragOver);
....
private void lblTitle_DragOver(object sender, DragEventArgs e)
{
DragEventArgs args = new DragEventArgs(e.Data, e.Effect, this);
base.OnDragOver(args);
}
I also tried with the Label itself as "dragSource" (3. argument), just passed e to handler.
And I've added any Mouse/Drag event like the example above.
Still not working. No panel move if the mouse is not exactly on the panel (without a subcontrol).
Any solution?
I bet there is something simple I'm just missing.
Thank you