Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Dynamic Color in Grid
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00244921
Message ID:
00245375
Vues:
29
>Right. I create MyGrid class. Add prop MyColor to grid. Add code to grid AARC to set DynamicColor stuff.
>
>I also create MyTextBox class. Add this.backcolor = this.parent.parent.MyColor to gotfocus event.
>
>In MyGrid init add code to addobject MyTextBox to each column.
>
>Now I drop MyGrid on a form run it and it works fine.
>
>A side effect of this is that you can't add any code to the grids text box without doing it at the MyTextBox class level.
>
>If I drop Mygrid on a form and want to add some code to the text box click I can't, it gets replaced at runtime.

This is true, and a common limitation working with grids. If you're going to replace default controls, you'll have to do things the way you are...it's a trade-off (unless they improve it someday :)

I usually just use a number of different grid classes, since they serve different functions anyway, and don't bother to replace the default controls, maybe just removing some columns, and work with the visual/default classes...I almost always have to manually enter header captions, anyway, since they're dictated by requirements, and cannot be just control sources...
The Anonymous Bureaucrat,
and frankly, quite content not to be
a member of either major US political party.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform