Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need to programatically create a form and populate it
Message
From
23/10/2006 16:13:52
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
23/10/2006 16:07:10
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01163982
Message ID:
01163985
Views:
9
>I am getting old and losing my mind. Someone please help me to remember:
>
>I am converting a fpd2.6 app and want to read the prgs and build a form with labels from the @say's and textboxes from the @get's. I also want to give values to certain properties like value for the labels and datasource for the textboxes.
>
>thanks, jeffrey

Create an empty form, and paste the following sample into Form.Init().
This.AddObject("TxtClientCode", "TextBox")
with ThisForm.TxtClientCode
	.Left = 10
	.Top = 50
	.Width = 100
	* .ControlSource = Client.ClientCode
	.Visible = .T. && or just .Show()
endwith
Note that the object is made visible at the end - initially, it is invisible, to avoid the object from visually jumping around when you change its properties.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform