Click here to Skip to main content
15,884,537 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
I am using a separate LED screen connected with my developing laptop. When I create a new form it always appear in the other screen (if Mother form is in screen1 child form appear in screen 2 and if Mother form is in screen 2 child form appear in screen1). I am using following conventional code to do that.

Form1 frm = new Form1();
frm.ShowDialog();


Please advice me to get the child form in the same screen, where the mother form lays.

Thanks for helping,
Kushan Randima.
Software Engineer
Davton Ltd
Posted
Updated 21-Oct-14 20:56pm
v2
Comments
BillWoodruff 15-Oct-14 8:04am    
You use the term "child Form" but I think you do not mean you have actually mean Form that is a child of another Form because you set its 'Parent property to the Form you call the "mother" Form. Is that correct ?

Hi Kushan, check the child form property window. There is a property named "Start Position". Change the "Windows default bound" value to "CenterParent".
 
Share this answer
 
frm.StartPosition = CenterParent

This should do the trick :)
You might have to qualify centerParent with the namespace / Enum which I cannot recall at the moment (probably FormPosition)

If this helps, please take time to accept the solution. Thank you.
 
Share this answer
 
v2

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