|
ListBox1->Items->Add('A');
ListBox1->Items->Add('B');
ListBox1->Items->Add('C');
이러면 ListBox에는 A, B, C 가 들어가 있는데요
for문을 돌렸습니다.
char strTemp;
strTemp = 'C';
for (int i = 0, i < ListBox1->Count; i++)
{
if(ListBox1->Items->Text == strTemp)
{
char str;
str = ListBox1->Items->Text;
Memo1->Lines->Add(str);
}
}
리스트 박스 카운터 만큼 돌면서 strTemp값 과 비교해서 같은 값이면 메모장에 찍어줄라고 하는데요.
if문 안에 저렇게 쓰니까 에러고여 이것저것 다 써봤는데 ListBox안 값 하나만 가져올 방법이 없더라고요.
혹시 방법 아시는분 계신가요?
|