Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to make mygrid contain mytextbox?
Message
From
02/11/1998 09:53:48
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00152433
Message ID:
00153484
Views:
22
>>>Is there a way to make mygrid class contain mytextbox class when creating a grid instead of the VFP textbox class?
>>Hi Colin,
>>There are design time and runtime solutions. For desgn time as David suggested already you can use a builder. Here is a sample I use for quick grid controls class change :
lParameters lcOldClass, lcNewClass, lcClassLib, lcApplyTo, lcKeepProperty, lcParams
>
>
>
>Thanks very much for the sample Cetin. I haven't had time to go over the code yet so I need to know this. If I run this to change controls that have code already in certain methods/events will it be retained? Thanks again.

Hi Colin,
In form designer you select one or more grids then run the code from command window ie: =gridbuild("textbox","mytextbox","myclasses") (as noted in comments). In this example all (could specify a columnlist) "textbox" classes in selected grids are replaced with "mytextbox" from "myclasses.vcx" as if you selected current textbox, removed and added mytextbox in designer (Code removeobjects textbox and addobjects "mytextbox" ). So if there are method codes already in columns(x).text1, it's gone. I use this little code immediately after using default grid builder to set controlsources etc. It's a quick builder code for only grids so I needn't to register it as a builder at all.
In your case, I would get a copy of grid, select copy in designer, run the code then modify code for some columns, containing code (if code couldn't be controlled at class level), then delete old grid.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform