Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to set the default Text Box Class of Columns in a Gr
Message
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00579973
Message ID:
00580004
Views:
18
>I want all a Grid's Columns to use MyTextBox SubClass instead of the Base TextBox Class. This can be done by manually adding a new Textbox to each column and setting the CurrentControl to that the new object. But this is slow and if I increase the number of Columns, I have to do it again.
********************************************************************
*  Description.......: GridBuilder - allows to build a grid in design-time
*  Calling Samples...:
*  Parameter List....:
*  Created by........: Cetin Basoz
*  Modified by.......: Nadya Nosonovsky 10/25/2001 04:14:31 PM
********************************************************************
*custom builder not registered
aselobj(arrObj)
for each oObj in arrObj
     if upper(oObj.baseclass)='GRID'
          for each oColumn in oObj.columns
               with oColumn
                    if type(.controlsource<>"L"
                         if type('oColumn.text1')="O" and lower(.text1.baseclass)='textbox'
                              .removeobject('text1')
                              .newobject('text1','EditInGrid','nAdditions.vcx')
                         endif
                    else && Logical field
                         if type('oColumn.text1')="O" and lower(.text1.baseclass)='textbox'
                              .removeobject('text1')
                              .newobject('check1','checkbox')
                              .check1.caption = ''
                              .sparse = .f.                              
                         endif
                    endif
                    .name = "col"+proper(justext(.controlsource))
                    .Header1.fontbold = .t.
                    .Header1.alignment = 2
               endwith
          next
     endif
next
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform