|
질문이 너무 간략해서 저도 잘 모르겠네요.. 대충 관련된 것을 설명해 드리자면..
CheckListBox의 경우에는 Columns 프로퍼티를 늘리고 Height를 줄인다면, 가로로 사용할 수 있고요.
StringList에서의 ComboBox로 동적 생성을 할 수 있겠지만, 이 경우에는 상당히 무거워지니, 따로 컴포넌트를 만드시거나 구하시는 쪽을 권해드리고 싶네요.
아래 소스는 동적 생성로 StringList의 모든 세로의 첫번째 칸에 ComboBox를 넣는 소스입니다. 새 프로젝트를 만드시고, 아무것도 올려놓지 마시고 컴파일 하셔서 사용하세요.
만약 답변된 내용이 틀린거라면.. 초짜님 말씀대로 다시 질문을 올려주시면, 아시는 분이 답변을 해드릴껍니다.
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
#define MAXCOUNT 30
TForm1 *Form1;
TCheckBox *StringGridCheckBox[MAXCOUNT];
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner) : TForm(Owner)
{
int itCount;
TStringGrid *StringGrid;
for(itCount = 0; itCount < MAXCOUNT; itCount ++)
StringGridCheckBox[itCount] = new TCheckBox(Application);
StringGrid = new TStringGrid(Application);
StringGrid->Parent = Form1;
StringGrid->Left = 50;
StringGrid->Top = 50;
StringGrid->FixedCols = 0;
StringGrid->FixedRows = 0;
StringGrid->OnTopLeftChanged = StringGrid1TopLeftChanged;
StringGrid->RowCount = MAXCOUNT;
StringGrid1TopLeftChanged(StringGrid);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::StringGrid1TopLeftChanged(TObject *Sender)
{
int itCount;
TRect Rect;
for(itCount = 0; itCount < MAXCOUNT; itCount ++) {
Rect = dynamic_cast<TStringGrid *>(Sender)->CellRect(0, itCount);
StringGridCheckBox[itCount]->Parent = dynamic_cast<TStringGrid *>(Sender);
StringGridCheckBox[itCount]->SetBounds(Rect.Left, Rect.Top, Rect.Left + 15, Rect.Height());
StringGridCheckBox[itCount]->OnMouseDown = CheckBox1MouseDown;
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::CheckBox1MouseDown(TObject *Sender, TMouseButton Button, TShiftState Shift, int X, int Y)
{
dynamic_cast<TCheckBox *>(Sender)->Checked = !dynamic_cast<TCheckBox *>(Sender)->Checked;
}
//---------------------------------------------------------------------------
볼랜드입문^^ 님이 쓰신 글 :
: 글구 체크리스트박스에서 가로로 체크리스트를 만들수는 업는지요^^?
:
|