Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to make mygrid contain mytextbox?
Message
 
À
02/11/1998 09:53:48
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00152433
Message ID:
00153493
Vues:
25
>>>>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

Got it. Thanks again Cetin.
Colin Magee
Team Leader, Systems Development
Metroland Media Group Ltd.
Mississauga, Ontario, Canada

cmagee@metroland.com

Never mistake having a career with having a life.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform