Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Dockable Form Migrates
Message
From
04/05/2007 08:35:30
 
 
To
03/05/2007 14:35:09
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01222276
Message ID:
01222446
Views:
16
Hi Frank.
>omyForm = CREATEOBJECT("Form")
>omyForm.Dockable = 1 && the form is automatically made visible here!
>?'Top1 ' + trans(omyForm.Top)
>?'Left1 ' + trans(omyForm.Left)
>omyForm.Visible = .f.
>omyForm.Visible = .T. && the form has now moved down from where it was originally
>?'Top2 ' + trans(omyForm.Top)
>?'Left2 ' + trans(omyForm.Left)
Interesting. It turns out Top is moved down by SYSMETRIC(4) (the height of the window frame) + SYSMETRIC(34) (the height of a half-height caption, since dockable forms use that) and Left is moved over by SYSMETRIC(3) (the width of the window frame). Something you may not have noticed is that Height and Width are reduced accordingly. You can see that visually with this code:
omyForm1 = createobject('Form')
omyForm1.HalfHeightCaption = .T.
omyForm1.Visible = .T.

omyForm = CREATEOBJECT("Form")
omyForm.Dockable = 1 && the form is automatically made visible here!
?'Top1 ' + trans(omyForm.Top)
?'Left1 ' + trans(omyForm.Left)
suspend

omyForm.Visible = .f.
omyForm.Visible = .T. && the form has now moved down from where it was originally
?'Top2 ' + trans(omyForm.Top)
?'Left2 ' + trans(omyForm.Left)

suspend
Notice that initially the dockable form is the same height as the non-dockable, but after you type RESUME in the Command window, it exactly fits inside the client area of the non-dockable form.

I think this is by design. Dockable forms have a lot of weird issues. To control visibility, I usually set Dockable to .T. in the Show method so it does become visible until just before the form would have anyway.

Doug
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform