Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Tip of the day. Scrollable containers, the easy way
Message
From
30/04/2012 08:25:23
Walter Meester
HoogkarspelNetherlands
 
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
01542846
Message ID:
01542871
Views:
123
Hi Cyril

You can create both the scrollable container and the main form as a form class visually through the form designer.
The scrollable container form should have the scrollbars set on and the titlebar set off. Then within the init of the mainform, you CREATEOBJECT() the scrollable container, store the reference to a property, and use ACTIVATE WINDOW ... IN WINDOW .... to show it within the boundaries of the main form.

Walter,


>>Hi All,
>>
>>I'm not sure whether someone else has ever come up with this before...
>>
>>Its not neccesary to complicate things to get a scrollable container. You can design the scrollable container as a normal form with scrollbars and put that on another form.
>>
>>
>>PUBLIC x
>>x = CREATEOBJECT("Mainform")
>>x.Show()
>>
>>*-
>>
>>DEFINE CLASS MainForm as Form
>>	SContainer = NULL 
>>	width = 700
>>	Height = 400
>>	
>>	ADD OBJECT Pgf AS PageFrame WITH left = 5, Top =210, Width = 690, Height = 180, pagecount = 2, TabStyle = 1, Anchor = 14 
>>
>>	FUNCTION Init
>>		THIS.sContainer = CREATEOBJECT("SContainer")
>>		ACTIVATE WINDOW (THIS.sContainer.Name) IN WINDOW (THIS.Name)
>>		THIS.sContainer.Show()
>>		THIS.Resize()
>>	ENDFUNC
>>
>>	FUNCTION resize
>>		THIS.sContainer.Move(0,0, THIS.Width - SYSMETRIC(5), THIS.Height - 200 - SYSMETRIC(6))
>>	ENDFUNC
>>ENDDEFINE
>>
>>*-
>>
>>DEFINE CLASS Scontainer as Form
>>	Scrollbars = 3
>>	TitleBar= 0
>>	BorderStyle = 0
>>		
>>	ADD OBJECT Explanation as Label WITH Caption = "This is the scrollable container", left = 100, top = 100, autosize = .t.
>>	ADD OBJECT FarObject as commandbutton WITH Left = 1000, top = 1000
>>ENDDEFINE
>>
>
>Walter
>
>Tried to do this visually with a form and class (attached).
>Gives: Object class is invalid for this container.
>
>Can it be done visually?
>
>Cyril
Previous
Reply
Map
View

Click here to load this message in the networking platform