Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Location of Child form on screen
Message
From
20/01/2004 13:20:00
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00868641
Message ID:
00868645
Views:
20
How do I determine where on the screen the child form will appear? Is it a property
>of the child form?


You can actually tell the child form where you want it to appear when you call it like so:

Code in Parent form to instatiate child form:
LOCAL luValue, lnTop, lnLeft

*** Calculate where the popup form should be instantiated
*** So it pops up directly below this control
*** SYSMETRIC( 9 ) is the height of the Form's title bar in case you were curious

lnTop = OBJTOCLIENT( Thisform, 1 ) + OBJTOCLIENT( This, 1 ) + This.Height + ;
              IIF( Thisform.TitleBar = 1, SYSMETRIC( 9 ) + 2, 2 )
lnLeft = OBJTOCLIENT( Thisform, 2 ) + OBJTOCLIENT( This, 2 )
DO FORM MyForm WITH lnTop, lnLeft TO luValue
Code in the init of the child form:
LPARAMETERS tnTop, tnLeft
WITH Thisform
  *** Position it correctly
  .Top = tnTop
  .Left = tnLeft
ENDWITH
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform