|
CellRect는 도움말을보니, Grid 기준 좌표 이며 보이지 않을때는 0을 반환한다네요.
AdvStringGrid 위에 label 써서 표현 해야 되는 상황이 이해는 안되지만,
AdvStringGrid1->ColWidth[nCol];
AdvStringGrid1->RowHeight[nRow];
를 쓰는 방법도 있겠네요.
int tmpTop=0;
int tmpLeft=0;
for(int nRow = 0 ; nRow < 10 ; nRow++)
{
Label[nRow]->SetBounds(tmpLeft,tmpTop,AdvStringGrid1->ColWidths[0],AdvStringGrid1->RowHeights[nRow]);
Label[nRow]->Caption = String(nRow) + "라인";
tmpTop+=AdvStringGrid1->RowHeights[nRow];
}
문경재 님이 쓰신 글 :
: Row가 10개인 그리드가 있고
:
: 그리드의 높이가 가변적일때
:
: 그리드 위에 각 row마다 Label로 표시를 해줍니다..
:
: for(int nRow = 0 ; nRow < 10 ; nRow++)
: {
: TRect rect = AdvStringGrid1->CellRect(0,nRow);
: Label[nRow]->Left = rect.left;
: Label[nRow]->Top = rect.top;
: Label[nRow]->Width = rect.Width();
: Label[nRow]->Height = rect.Height();
: Label[nRow]->Caption = String(nRow) + "라인";
: }
:
: 이런식으로 프로그램을 적용시켰는데요
:
: 한화면에 보일때는 문제없이 LEFT , TOP을 잘찾는데
:
: RowHeight가 커지면서 그리드의 상하 스크롤 바가 생기면
:
: 화면에 안보이는 부분의 Top위치를 찾지 못하는데요..
:
: 해결방법이 있을까요??
:
:
:
|