|
안녕하세요.아래코드는 제가 BtnLEDOK버튼을 클릭시에
이미지들에 색깔이나 등등의 속성을 지정해주고 또 텍스트에 색이나 등등을 입력하고나서
버튼을 누르면 추가되도록 해보고 싶어서요.
BtnLEDClear버튼을 클릭시에는 생성된 이미지의 속성들을 제거해주려고 함 시도해본건데요
맞는건지요? 제거는 아니되거든요,,
typedef struct AList //구조체 선언
{
//String Color;
String I;
String C;
} TAList;
typedef TAList* PAList;
void __fastcall TLED::BtnLEDOKClick(TObject *Sender)
{
PAList AStruct;
TList *MyList = new TList;
// fill the TList
AStruct = new TAList;
AStruct->I = ETime_ms->Text;
AStruct->C = ERepeat->Text;
MyList->Add(LblTList1);
AStruct = new TAList;
AStruct->I = ETime_ms->Text;
AStruct->C = ERepeat->Text;
MyList->Add(AStruct);
MyList->Add(LblTList3);
int MyListCnt = MyList->Count;
AStruct = (PAList)MyList->Items[idx];
if(idx == 0)
{
Edit3->Text = AStruct->I;
Edit4->Text = AStruct->C;
//LblTList1->Color = Edit3->Text->AsString;
}
else if(idx == 1)
{
Edit1->Text = AStruct->I;
Edit2->Text = AStruct->C;
}
idx++;
ETime_ms->Text = "";
ERepeat->Text = "";
}
//---------------------------------------------------------------------------
void __fastcall TLED::BtnLEDClearClick(TObject *Sender)
{
PAList AStruct;
TList *MyList = new TList;
AStruct = new TAList;
int MyListCnt = MyList->Count - 1;
// for (int i = 0; i < MyList->Count; i++)
// {
AStruct = (PAList) MyList->Items[MyListCnt];
delete AStruct;
// }
delete MyList;
|