Catching window events

Topics: CAB & Smart Client Software Factory
Apr 3, 2007 at 4:39 AM
I have a docked window from which I need to catch a onmove and onresize events. The OnResize function exists in System.Windows.Forms.UserControl and works just find when I override it. However, there is no OnMove function in Control. (There is one in System.Windows.Forms.Control, but it is never run for some reason. Shouldn't it be run?
Apr 3, 2007 at 5:20 AM

Joachim wrote:
I have a docked window from which I need to catch a onmove and onresize events. The OnResize function exists in System.Windows.Forms.UserControl and works just find when I override it. However, there is no OnMove function in Control. (There is one in System.Windows.Forms.Control, but it is never run for some reason. Shouldn't it be run?


I assume that the Form events are encapsulated inside the CompositeUI.WinForms.WindowWorkspace.WindowForm (for WindowWorkspace). However, I don't see any handling of onmove or onresize there, which I need. I really need that event. What would be the best way to solve this?
Apr 3, 2007 at 10:36 AM
What control suite did you use as the basis of your dock workspace?
What do you want to achieve with those events?
I have a workspace that's based on weifen luo's dockpanel suite. Do you know it?
Apr 3, 2007 at 10:50 AM

nuchild wrote:
What control suite did you use as the basis of your dock workspace?
What do you want to achieve with those events?
I have a workspace that's based on weifen luo's dockpanel suite. Do you know it?


I'm not that experienced with CAB and I'm not sure what you mean by control suite. I need those events to be able to move the overlay window accordingly so that my video window follows the CAB window.
Apr 3, 2007 at 9:33 PM
Hello,

With "control suite" nuchild means if you are using third-party controls (a library you bought) or if you are using the standard system-controls.

I think from your answer you are using the system controls.

What I did not understand is you first talk about a usercontrol and then about a control. This demo-code will go into both eventhandlers.

private void biDBConnectQuick_Click(object sender, EventArgs e)
{
UserControl uc = new UserControl();
uc.Resize += new EventHandler(uc_Resize);
uc.Move += new EventHandler(uc_Move);
this.Controls.Add(uc);
uc.Size = new Size(100, 100);
uc.Location = new Point(10, 10);

}

void uc_Move(object sender, EventArgs e)
{
}

void uc_Resize(object sender, EventArgs e)
{
}

Best regards,
Ike
Apr 4, 2007 at 5:14 AM
Ok. Well, it is a standard UserControl that I am using, but the handling of window appearance is done by a third party library called SandDock from DivElements (http://www.divelements.com/net/controls/sanddock/). My problem perhaps lies with SandDock then...
Apr 4, 2007 at 9:24 PM
Hello,

So you don't need the onmove and onresize on the usercontrol, but you need it on the control that sanddock uses to dock.
In out 3rd party libary the docking mechanism is handled through specific panelcontrols. If sanddock also works like this, you need to search for these events on that control.

Best regards,
Ike