|
제가볼때 TListView 인것같습니다
TListView에 CheckBox가 들어가거든요
ListView->Checkboxes = true; ( 핵심 )
ListView->GridLines = true;
ListView->ViewStyle = vsReport ;
그리고
ListView->Columns를 몇개 추가하시구요
ListView->Items를 몇개 추가해 보십시요
이렇게 하시면 첨부한 사진과 같이 될것입니다.
위에 내용은 전부 클래스 properties 에 전부다 있습니다
디자인타임때 가능하죠
관련내요을 여기 검색하면 충분히 많이 나오지만...
간단한 예제 첨부합니다
//여러개 체크 되어있으며 체크된것을 확인하고자 한다면
void __fastcall TForm1::Button1Click(TObject *Sender)
{
for(int i=0;i<ListView1->Items->Count;i++)
{
if(ListView1->Items->Item[i]->Checked)
{
ShowMessage("체크 된것!");
}
else
{
ShowMessage("체크 안 된것!");
}
}
}
//---------------------------------------------------------------------------
//전부 체크하려면
void __fastcall TForm1::Button2Click(TObject *Sender)
{
for(int i=0;i<ListView1->Items->Count;i++)
{
ListView1->Items->Item[i]->Checked=true;
}
}
//---------------------------------------------------------------------------
//전부 체크를 풀려면
void __fastcall TForm1::Button3Click(TObject *Sender)
{
for(int i=0;i<ListView1->Items->Count;i++)
{
ListView1->Items->Item[i]->Checked=false;
}
}
//---------------------------------------------------------------------------
//체크된것만 삭제하려면
//---------------------------------------------------------------------------
void __fastcall TForm1::Button4Click(TObject *Sender)
{
for(int i=ListView1->Items->Count;i>0;i--)
{
if(ListView1->Items->Item[i-1]->Checked)
ListView1->Items->Item[i-1]->Delete();
}
}
//---------------------------------------------------------------------------
우리 님이 쓰신 글 :
: 첨부파일에서 보는 것 같이
:
: 스트링 그리드 같은데 체크박스 같은것이 포함된 컴포넌트가있나요?
:
: 아니면 이런식으로 구현할 수 있는 방법이 있나요?
:
: 혹시 아시는 분은 알려주시면 감사하겠습니다 ^^;
|