Click here to Skip to main content
15,887,027 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I would like Form2 location to be at the bottom of the Form1 like the old Winamp media player.
Posted
Updated 18-May-13 4:25am
v3
Comments
Basmeh Awad 18-May-13 10:10am    
not clear what you want to do...give more details

1 solution

How complex this is gets to be up to you:

To create a second form isn't complex: you just need to create the instance and call the Show method instead of ShowDialog.
You can then set it's location (provided you have set the StartPosition property to Manual) in the parent forms Shown event - just set it to the Parent form Location, plus the Parent form Size, plus any margin you want.

The complications come when you want to move the second form with the first, but that's not too bad: just handle the Parent Move event and move the Child form at the same time.

But if the user moves the Child form, should the Parent Move as well? If so, then you need to handle the Child Move event as well, and also prevent an eternal loop of the Parent move causing a Child move event, which causes a Parent move, which....

But a small amount of playing you get you there!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900