.
Et elle est définie comment?
Pour utiliser une variable d'un autre objet (dans ton cas un TForm), tu peux utiliser une donnée membre en public:
Code:
1 2 3 4 5 6
| //Dans ton *.h:
class TForm2 : public TForm
//[...]
public:
int nbreCol ;
{ |
Ensuite pour y accéder depuis une autre Form tu as juste un faire:
Code:
1 2 3 4
| for (i=0; i< Form2->nbreCol; i++ )
{
Series1->AddXY( i, i+1);
} |
Une autre solution (que je privilégierais) est d'utiliser une donnée membre privée, avec un accès publié via
__property:
Code:
1 2 3 4 5 6 7 8 9
| //Dans ton *.h:
class TForm2 : public TForm
//[...]
private:
int FnbreCol ;
//[...]
__published:
__property int nbrCol = { read=FnbreCol , write=FnbreCol };
{ |