Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Changing the default TextBox the Grid class uses
Message
De
18/06/1999 16:23:36
Kenneth Downs
Secure Data Software, Inc.
New York, États-Unis
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00231515
Message ID:
00231591
Vues:
19
>Hi all,
>
>I have created a class based on the grid call call MyGrid. I want to place some code in the click event of all the TextBoxs that MyGrid uses.
>
>So, I subclassed a TextBox to MyGridTextBox and added the code.
>
>My question is how to convince MyGrid to use MyGridTextBox when it is placed on a form?
>
>
>Thanks in advance for any help.

Roi,

I have good news and bad news. The bad news is that VFP doesn't do this easily, i.e., from the builders or from a setting or anything like that. The good news is that you can do it yourself if you want to do some coding.

The simplest approach is to put some code similar to this in your Grid's INIT:

For i = 1 TO MyGrid.ColumnCount
MyGrid.COlumns(i).RemoveObject("text1")
MyGrid.Columns(i).AddObject("MyTextBoxClass","text1")
ENDFOR

Hope this helps
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform