Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Header classes - please help!
Message
 
À
28/09/2000 16:44:02
Elyse Pomerantz
Dynamic Data Concepts, Inc.
Brooklyn, New York, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00422292
Message ID:
00422403
Vues:
23
Hi Elyse,

>I created my own header class in a PRG. In the Init of my grid class, I would like to replace the VFP headers with my header class. This is my code in the Grid.Init():
>
>FOR EACH loColumn IN This.Columns
> loColumn.RemoveObject("Header1")
> loColumn.AddObject("Header1","MyHeaderClass")
>ENDFOR
>
>I'm getting an error on the AddObject line-"Object name is invalid." If I use a different name, i.e. "HeaderA", it works. Why is this and how can I get around it? I really want to name the headers "Header1" because there are pieces of code that depend on the headers being named as such.

I don't know WHY the error occurs, but I got it too. So, what I did was the following:
FOR EACH loColumn IN This.Columns
     loColumn.RemoveObject("Header1")
     loColumn.AddObject("Hdr1","MyHeaderClass")
     loColumn.Hdr1.Name = "Header1"
ENDFOR
All is well!
Bill Armbrecht
VFP MCP
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform