//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
const int MAXX = 8;
const int MAXY = 8;
TBitBtn* meineBitBtns[MAXY][MAXX];
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormCreate(TObject *Sender)
{
for (int y=0; y < MAXY;y++)
{
for (int x=0; x < MAXX; x++) //Schleife, um 5 Labels dynamisch zu erstellen
{
meineBitBtns[y][x] = new TBitBtn(this);
meineBitBtns[y][x]->Parent = this;
meineBitBtns[y][x]->Top = 15+35*y;
meineBitBtns[y][x]->Left = 350+35*x;
meineBitBtns[y][x]->Width = 30;
meineBitBtns[y][x]->Height = 30;
meineBitBtns[y][x]->Caption = "Nr. " + IntToStr(x);
}
}
}
---------------------------------------------------------------------------------------------------------
Der Code müsste richtig sein, weil er bei nem Kumpel funzt... Wo liegt denn der Fehler?
edit: hat sich geklärt. mein c++ builder hat rumgesponnen
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
const int MAXX = 8;
const int MAXY = 8;
TBitBtn* meineBitBtns[MAXY][MAXX];
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormCreate(TObject *Sender)
{
for (int y=0; y < MAXY;y++)
{
for (int x=0; x < MAXX; x++) //Schleife, um 5 Labels dynamisch zu erstellen
{
meineBitBtns[y][x] = new TBitBtn(this);
meineBitBtns[y][x]->Parent = this;
meineBitBtns[y][x]->Top = 15+35*y;
meineBitBtns[y][x]->Left = 350+35*x;
meineBitBtns[y][x]->Width = 30;
meineBitBtns[y][x]->Height = 30;
meineBitBtns[y][x]->Caption = "Nr. " + IntToStr(x);
}
}
}
---------------------------------------------------------------------------------------------------------
Der Code müsste richtig sein, weil er bei nem Kumpel funzt... Wo liegt denn der Fehler?
edit: hat sich geklärt. mein c++ builder hat rumgesponnen