Q&A

  • 스트링 그리드 셀에 두줄로 보이는 방법좀..
스트링 그리드 한셀안에 두줄로 보이려면.. 어찌 해야 되는지요..

허~~~ 안되요.. 여기 Q&A계시판에서두 못찾구요.. 젤발.

1  COMMENTS
  • Profile
    stoney 2001.09.15 03:02
    WordWrap 기능 비슷하게 구현은 가능 하겠네요..



    procedure TMainForm.StringGrid1DrawCell(Sender: TObject; Col, Row: Integer;

    Rect: TRect; State: TGridDrawState);

    begin

    if (Col = 1) or (Col = 2) then

    begin

    StringGrid1.Canvas.Font := StringGrid1.Font; // 지정하지 않으면 System 폰트가 됨

    Rect.Left := Rect.Left+1;

    Rect.Top := Rect.Top+1;

    DrawText(StringGrid1.Canvas.Handle,

    PChar(StringGrid1.Cells[Col,Row]), // 출력할 문자열

    -1, // 문자열의 길이(-1로 지정하면 자동 계산)

    Rect,

    DT_WORDBREAK);

    end

    else

    begin

    StringGrid1.Canvas.FillRect(Rect);

    StringGrid1.Canvas.TextOut(Rect.Left+2,Rect.Top+2, StringGrid1.Cells[Col, Row]);

    end;

    end;



    뛰는초보 wrote:

    > 스트링 그리드 한셀안에 두줄로 보이려면.. 어찌 해야 되는지요..

    > 허~~~ 안되요.. 여기 Q&A계시판에서두 못찾구요.. 젤발.