Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Simple Grid Classes Question
Message
De
08/05/1997 10:06:25
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00031193
Message ID:
00031329
Vues:
43
>>Ok, this is probably an easy one.
>>
>>I've been converted to loving (at least seriously liking) custom classes when developing my forms to avoid duplicate work, especially formatting.
>>
>>My forms need a bunch of grids so I created a grid class with specific formatting of column/text fonts etc. but it looks like this will only work if the grid I create on the form has the exact same number of columns as the grid class, i.e. it won't let me change the number of columns in the form grid instance. Am I correct? Is there any way around this so all of my grid columns are "Arial 8 bold"?
>>
>>thanks! You guys are a wonderful wealth of info.
>>
>>Mandy
>
>Mandy, I learned the following from Drew Speedie's Visual MaxFrame, and it seemed like a great trick:
>
>First, make a grid class with 10 columns (your choice, but more than you generally need). Next add a class property called nColCount. Set up each of the 10 columns the way you want them - fonts, etc., but leave them each very narrow for convenience. In the INIT, place this.columncount = this.nColCount. This gets rid of the 'extra' columns on loading.
>
>On your form, just set up the columns you WANT, leaving the others with the defaults - they disappear when the form is loaded.
>
>I've only used the VMF version, so let me know if my summary of his procedure works.
>
>HTH
>Barbara
Hi Barbara,
We also have a custom grid we call 'smartgrid' that actual has 0 columns in the our base class. We addobject 'columns' in the init method of the grid and set the headers, contained controls (text edit etc.) and any other properties. We also put in the base class properties for the masteralias and such plus code in the valid, when, before/after column change to implement row highliting and come other custom behaviors. When the class is drop on a form we add code the init methods to creating columns and set up the masteralias property.

I've been meaning the make this a little more generic add to our GizGad product. I'll try to get to that sooner than later.
Hope this gets you started in the right direction.
Gary
Gary
Helping Make Ideas Reality
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform