EliCat
Newcomer
I seem to have some weird problem with the start position of one of my forms.
My forms open in this order and StartPosition
1) Mainform ... WindowsDefaultLocation
2) Reportform ... WindowsDefaultLocation and it's an MDIChild with the Mainform as the container
3) Selectform ... CenterParent; this form is opened by a button on the Reportform
The way I've set the StartPosition I would think that my select form would open in the center of the report form, but it doesn't.
The first time I open it it starts in a random position.
If I close and then reopen it starts up in the most top, left corner and each close/open procedure after that it opens at location (x,x) where x gets increasingly larger until it reaches a certain point, then it goes back to (0.0) again and starts all over.
It doesn't seem to matter to which position I drag my main+reportform (they're not full screen) ... the procedure above happens no matter what.
The weird thing is if I set my Selectform to "CenterScreen" instead it works perfectly and always starts in the center of the screen.
I've already bypassed the problem for this form by assigning parameters for the StartLocation (now set to Manual) before opening it and calculating them so that they open the Selectform in the center of my Mainform (instead of the Reportform), but I don't want to keep running into this problem and having to bypass it for each form I open.
Am I missing something about how CenterParent is supposed to work?
Or is it something that has to do with my Reportform being a MDI child?
My forms open in this order and StartPosition
1) Mainform ... WindowsDefaultLocation
2) Reportform ... WindowsDefaultLocation and it's an MDIChild with the Mainform as the container
3) Selectform ... CenterParent; this form is opened by a button on the Reportform
The way I've set the StartPosition I would think that my select form would open in the center of the report form, but it doesn't.
The first time I open it it starts in a random position.
If I close and then reopen it starts up in the most top, left corner and each close/open procedure after that it opens at location (x,x) where x gets increasingly larger until it reaches a certain point, then it goes back to (0.0) again and starts all over.
It doesn't seem to matter to which position I drag my main+reportform (they're not full screen) ... the procedure above happens no matter what.
The weird thing is if I set my Selectform to "CenterScreen" instead it works perfectly and always starts in the center of the screen.
I've already bypassed the problem for this form by assigning parameters for the StartLocation (now set to Manual) before opening it and calculating them so that they open the Selectform in the center of my Mainform (instead of the Reportform), but I don't want to keep running into this problem and having to bypass it for each form I open.
Am I missing something about how CenterParent is supposed to work?
Or is it something that has to do with my Reportform being a MDI child?