Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Textboxes for grid from class?
Message
From
20/07/2000 09:00:53
Mark Hall
Independent Developer & Voip Specialist
Keston, Kent, United Kingdom
 
 
To
20/07/2000 08:17:40
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00394826
Message ID:
00394841
Views:
14
>Hello,
>
>I have a grid on my form, initially it's columncount is set to -1. Programatically I set the columncount to 5 (for example) and specify the properties for each column etc.
>However, always the baseclass TextBox is used to populate the columns, is there a way to populate the columns with another textbox class, because I need to have some methods in them.
>
>Thanks for help.

Hi,

This can be done both graphically, or from code.

In code, for each column

loColumn.RemoveObject("text1")
loColumn.AddObject("txtNewTextbox", "txtClassName")
loColumn.CurrentControl = "txtNewTextbox"
* You might want sparse = .f. also
loColumn.Sparse = .f.

Graphically (a bit long winded and it's probably in a FAQ somewhere).
1) Select the text1 control from the appropriate grid column in the object list of the properties window.
2) Click with the mouse oonce on the title bar of your new form (in the design window)
3) Press the delete key - This will delete the text1 object from the grid column

4) Set the Form Controls toolbar up so that it's showing the visual classes from the class library containing the new textbox class
5) select the grid column object from the object list of the properties window
6) Click once on your new Textbox class in the toolbar, then click once in the column of the grid.

This will add a new textbox, created from your class definition.
Regards
Mark

Microsoft VFP MCP
Menulib - OO Menus for VFP www.hidb.com/menulib
Previous
Reply
Map
View

Click here to load this message in the networking platform