Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Changing the default TextBox the Grid class uses
Message
From
18/06/1999 16:23:36
Kenneth Downs
Secure Data Software, Inc.
New York, United States
 
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00231515
Message ID:
00231591
Views:
17
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform