Topic: Centre Child Forms relative to Main Form
Hello All,
Some help if anyone has any ideas please.
THE PROBLEM
I have an application with a main form (Form1) and a number of child forms (see screen1 in the attachment).
However, if I move Form1 anywhere on the monitor, then the child form is no longer centred on Form1 (see screen2 in the attachment).
WHAT I DO AT THE MOMENT
The position of the child forms is forced to be centred on Form1 with a script (see screen3 in the attachment).
But within the procedure, the code to re-centre each child form is repeated - the more child forms, the more the code is repeated. This is what I want to avoid.
WHAT I'M TRYING TO DO (without success!)
Create a procedure (similar to screen4 in the attachment (which obviously is incorrect at the moment)) that
1. uses a variable ('vform') to identify the name of any child form that has just been opened and
2. uses that variable as part of the formula to re-centre the child form.
I'm using Windows 10 / MVD 6.5.
Any ideas and help would be appreciated.
Regards,
Derek.