|
음 홍식님이 하신 그대로 카피해서 해보았는데요
에러없이 잘도는대요 ㅠ.ㅠ
제가 테스트 해본 소스예요
static int count = 1;
void __fastcall TForm1::Button3Click(TObject *Sender)
{
if(count == 1) {
for(int i=1; i<Form1->ComponentCount; i++) {
if(String(Form1->Controls[i]->ClassName()) == "TPanel")
((TPanel *)(Controls[i]))->Color = clRed;
}
count = 2;
}
else if(count == 2) {
for(int i=1; i <Form1->ComponentCount; i++){
if(String(Form1->Controls[i]->ClassName()) == "TPanel")
((TPanel *)(Controls[i]))->Color = clBlue;
}
count = 1;
}
}
김훙식 님이 쓰신 글 :
: 먼저 답변 갑사합니다.
: for (int m=0; m<=8; m++) {
: if(Switch.SubString(m,1) == "0") {
: for(int i=1; i<FormCfg_102->ComponentCount-1; i++) {
: if(String(FormCfg_102->Controls[i]->ClassName()) == "TPanel")
: ((TPanel *)(Controls[i]))->Color = clRed;
: }
: }
: else if(Switch.SubString(m,1) == "1") {
: for(int i=1; i <FormCfg_102->ComponentCount-1; i++){
: if(String(FormCfg_102->Controls[i]->ClassName()) == "TPanel")
: ((TPanel *)(Controls[i]))->Color = clBlue;
: }
: }
: }
:
: 컴파일은 되는데 실행시 오류 메세지가
: Access violation ata address 022F8BD0 in module 'CFG_102(= 프로그램 이름'
: Read of address FFFFFFFF.
: 좀 도와주세용.
|