Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid using myTextBox class
Message
From
29/09/2005 14:56:41
 
 
To
29/09/2005 11:14:17
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows 2000 SP4
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01054499
Message ID:
01054629
Views:
20
This message has been marked as the solution to the initial question of the thread.
>When I set the grid.columncount = 2 FoxPro automatically uses it's own textbox class for the two columns. How can I direct it to use my own textbox class instead?
>
>Thanks for any help given

VFP8 and up have MemberClass and MemberClassLibrary properties you can use.
* gridstuff.prg

DEFINE CLASS myGrid AS Grid
MemberClass = "myColumn"
MemberClassLibrary = "gridstuff.prg"
ENDDEFINE

DEFINE CLASS myColumn AS Column
HeaderClass = "myHeader"
HeaderClassLibrary = "gridstuff.prg"
Width = 25
ADD OBJECT Text1 AS myText
ENDDEFINE

DEFINE CLASS myHeader AS Header
FontName = "Comic Sans MS"
FontSize = 12
Caption = "myHeader"
ENDDEFINE

DEFINE CLASS myText AS TextBox
FontName = "Chick"
ENDDEFINE
The above example defines custom classes for myGrid for the Column, Header and TextBox used, so that when you change the column count, you'll use these custom classes instead of the VFP defaults.

If you need multiple formats, you can even change the MemberClass and/or MemberClassLibrary properties and add your columns in sections.

Columns 1-3 in one format, change the properties, columns 4-8 in another format, change the properties, etc.
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform