C++Builder Programming Forum
C++Builder  |  Delphi  |  FireMonkey  |  C/C++  |  Free Pascal  |  Firebird
볼랜드포럼 BorlandForum
 경고! 게시물 작성자의 사전 허락없는 메일주소 추출행위 절대 금지
C++빌더 포럼
Q & A
FAQ
팁&트릭
강좌/문서
자료실
컴포넌트/라이브러리
메신저 프로젝트
볼랜드포럼 홈
헤드라인 뉴스
IT 뉴스
공지사항
자유게시판
해피 브레이크
공동 프로젝트
구인/구직
회원 장터
건의사항
운영진 게시판
회원 메뉴
북마크
볼랜드포럼 광고 모집

C++빌더 Q&A
C++Builder Programming Q&A
[7909] TList에 대해서 질문
김민연 [] 1262 읽음    2001-06-01 15:51
안녕하세요.아래코드는 제가 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;

+ -

관련 글 리스트
7909 TList에 대해서 질문 김민연 1262 2001/06/01
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.