c# - Moving two forms together without changing the positions (behind or front) of the two forms -


I'm quite new to C # Recently, I got stuck on a problem that I used to do with two different forms I want to take it together.

In more detail,

A large form (some as a basic window) popup small forms

What do I want to do, both of these forms To move the original window at the same time is to move.

And, now I am the "small" () "method of form" problem is that if I click on the form of a parent, then the form of a small form (i.e. Form).

I know what this should be. However, I want to transfer these two forms by moving the small form and keeping the small form in front.

I also considered using "Schodilog ()". But, it prevents me from transferring older parents. I can not touch the parent window.

Set the owner property of the child as parent:

< Pre> this.childForm = new ChildFormClass (); children. Onner = this; ViewForm.ShowDialog (); // Instead of setting it to owner property it can be said: //viewForm.ShowDialog(this);

Reference:

In this way, the child's form will never be shown behind the parent.

Edit:

To move both forms together, just move the parent form to the event:

  Private Zero form 1_Move (Object Sender, EventArgs E) {Point P = this.PointToScreen (New point (this.ClientRectangle.X, This.ClientRectangle.Y)); This.childForm.Location = p; // ChildForm is required to be a class member)  

Cheers


Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -