• Welcome to PlanetSquires Forums.
 

WinFBE 2.0.3 - Form

Started by SeaVipe, February 13, 2020, 03:54:30 PM

Previous topic - Next topic

SeaVipe

Hi Paul, To show a sub form modal I'm using the following:
frmJedit.ShowDialog( frmMainj.hWindow )
My development machine has 2 monitors. Monitor #1 is the work monitor. frmMainj (the main form) of my WinFBE app is shown on monitor #2.
A sub form (frmJedit) is used to edit the values of a ListView on frmMainj.
On form Closing, the position of the sub form is saved to an ini file so that the sub form is positioned the same the next time it is shown.
However, the saved position is off screen Like so:
Quote

[Jeditor]
; Edit Form startup pos. and size
top=-86 ; off screen
left=-1920 ; off screen and it is the negative value of the main form's left (1920)
Height=509
Width=597
To solve this issue I have to show the sub form modeless
frmJedit.Show
Which results in the following ini file values when the sub form is closing:
Quote

[Jeditor]
; Edit Form startup pos. and size
top=286 ; correct
left=2105 ; correct
Height=509
Width=597
Using Visual Designer, I've tried many different settings on both the main form and the sub form but the result is much the same.

UPDATE. Changed code to force the sub form to be centred over the parent form. ;0)
Clive Richey