Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Anyone has a way to "render" the form as IE does?
Message
From
22/01/2007 21:17:11
 
 
To
22/01/2007 11:21:22
Mike Sue-Ping
Cambridge, Ontario, Canada
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
01187703
Message ID:
01187958
Views:
16
This message has been marked as a message which has helped to the initial question of the thread.
>I like the way HTML automatically "reflows" when a browser window is resized. Is there any way to duplicate this behavior in a VFP form?
>
>I've tried playing with the control's Anchor property (relative vs absolute) but cannot make them "reflow" like in a browser.
>
>Does anyone know if this can be done with pure VFP code/controls? I know that I can use the webbrowser control in a VFP form and have it render HTML but this technique is causing some problems in itself (like input text reverting to wrong values on refreshing). I'd like to have this done in 100% VFP.
>
>TIA
>
>Mike


Hi Mike,

I don't know whether this is a good solution or not. But I hope it give you the clue to get started.
Try this. The class will re-position the top coordinate.

1. create a custom class base on Label

2. set it's properties:
Anchor = 10
WordWrap = .T.
AutoSize = .T.

3. add property:
nOldHeight = 0

4. add ACCESS method to Anchor property

5. Put this code:
*** Init event
This.nOldHeight = This.Height  && save the label height


*** Anchor_Access event
*To do: Modify this routine for the Access method

Local lo_Control, ln_SizeX, ln_X

With This
   If (.nOldHeight != .Height)  && the height is changed
      ln_SizeX = .Height - .nOldHeight  && get the differents
      .nOldHeight = .Height
      ThisForm.LockScreen = .T.

      For each lo_Control in .Parent.Controls
         If (lo_Control.Name != .Name) and (lo_Control.Top > .Top)
            * Re-position the top coordinate
            lo_Control.Top = lo_Control.Top + ln_SizeX
         endif
      EndFor
      lo_Control = Null

      ThisForm.LockScreen = .F.
   endif
EndWith

Return This.Anchor
Drop that object to the form. Change the caption and the width to your like.

Good luck!
Herman
Previous
Reply
Map
View

Click here to load this message in the networking platform