Q&A

  • 그리드에서 콤보박스를 넣으려는데여..
그리드 내의 컬럼 항목에 콤보박스를 넣으려면 어떻게 해야하나여..

답변 부탁드려여...^^

2  COMMENTS
  • Profile
    홍성락 2001.07.24 04:29
    StringGrid의 OnDrawCell이벤트를 사용하세요.

    ComboBox는 처음 Visible을 false로하세요



    if(gdfocused in state) then begin //해당그리드에 포커스가 있는지

    if (StringGrid1.Col = 0) then begin //원하는 컬럼에 마우스가 와있는지

    ComboBox1.Left := Rect.Left + StringGrid1.Left;

    ComboBox1.Top := Rect.Top + StringGrid1.Top;

    ComboBox1.Width := Rect.Right - Rect.Left;

    //지정한값에 인덱스지정

    ComboBox1.ItemIndex := ComboBox1.Items.IndexOf(sg1.Cells[sg1.Col, sg1.Row]);

    ComboBox1.visible := true;

    end

    else begin

    ComboBox1.Visible := false;

    end;

    end;



    왕초짜 wrote:

    > 그리드 내의 컬럼 항목에 콤보박스를 넣으려면 어떻게 해야하나여..

    > 답변 부탁드려여...^^

  • Profile
    왕초짜 2001.07.24 17:46
    답변 감사합니당 *^^*