请问:我做了一套酒店管理系统,用ListView控件来显示房态图,但它显示的房间有很大的间隔,现在用户要求将它尽量贴近,或者说要求每个房间不应有间隔。每行显示的房间也不应有间隔。用DBctrlGrid控件可以吗?若可以,请举个例子?望各位指点,谢谢!

解决方案 »

  1.   

    用TPanel吧, 在Panel中動態創建Panel呀
    樓主發了幾個呀.
      

  2.   

    procedure TForm1.FormCreate(Sender: TObject);
    var
      i, j: integer;
    begin
      j := 0;
      for i := 0 to 5 do
      begin
        with TPanel.Create(nil) do
        begin
          Parent := Panel1;
          Name := 'Panel' + IntToStr(i);
          width := 80;
          Height := 20;
          if (i + 1) * 80 > Panel1.Width then
          begin
            Left := 0;
            inc(j);
          end
          else
            Left := i * 80;
          Top := j * 20;
        end;
      end;
    end;
    //在Form上先加一個Panel
      

  3.   

    DBCtrlGrid控件可以做吗?是否最好?