Board index » cppbuilder » Array of StringGrids

Array of StringGrids


2005-10-13 12:51:37 PM
cppbuilder73
I would like to create 3 StringGrids on the same form at COMPILE time,
then create an array of these 3 grids at RUNTIME. I can do this with
Buttons etc but not much luck with StringGrids.
Can this be done?
If so I would appreciate a bit of sample code.
 
 

Re:Array of StringGrids

"Bruce Fullerton" < XXXX@XXXXX.COM >wrote in message
Quote
I would like to create 3 StringGrids on the same form at COMPILE
time, then create an array of these 3 grids at RUNTIME.
private:
TStringGrid Grids[3];
__fastcall TForm1::TForm1(TComponent *Owner)
: TForm(Owner)
{
Grids[0] = StringGrid1;
Grids[1] = StringGrid2;
Grids[2] = StringGrid3;
}
Quote
I can do this with Buttons etc but not much luck with StringGrids.
There is no difference between an array of buttons and an array of grids.
You are storing pointers in both situations.
Quote
Can this be done?
Of course. See above.
Gambit
 

Re:Array of StringGrids

"Remy Lebeau (TeamB)" < XXXX@XXXXX.COM >wrote in message
Quote

"Bruce Fullerton" < XXXX@XXXXX.COM >wrote in message
news:434de741$ XXXX@XXXXX.COM ...

>I would like to create 3 StringGrids on the same form at COMPILE
>time, then create an array of these 3 grids at RUNTIME.

private:
TStringGrid Grids[3];
That should be:
private:
TStringGrid *Grids[3];
- Dennis
 

{smallsort}