超难问题!!!!请问如何实现 "按钮表格" 的功能 (有图片) !!!!!!!
要求能动态生成 多个 按钮, 并把这些按钮像表格一样排列!!!  要自动显示滚动条!!!! 虽然可以用 toolbar 可以实现,但 toolbar的 按钮不能得到焦点!!!!!!请问有什么控件能实现??? 请问给出详细的代码!!!  我用的是 delphi6!!!
例子看下图:图1
http://www.ttx.com.cn/bbs/uppic/2005-10/2005104203144705.jpg图2http://www.ttx.com.cn/bbs/uppic/2005-10/2005104203158254.jpg

解决方案 »

  1.   

    给我50块钱,我帮你做
    [email protected]
      

  2.   

    试试frame,其他的就和操作form一样了。
      

  3.   

    楼主试试frame啊,frame和form一样,上面的控间可以获得焦点,而且自动支持滚动条。就像把多个form拼在一起。应该可以做出你截图中的界面了。
      

  4.   

    用StringGrid+Tbutton自己实现就可以,看看这样行不行
    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, StdCtrls, Buttons, Grids;type
      TForm1 = class(TForm)
        StringGrid1: TStringGrid;
        BitBtn1: TBitBtn;
        procedure BitBtn1Click(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;var
      Form1: TForm1;implementation{$R *.dfm}procedure TForm1.BitBtn1Click(Sender: TObject);
    var
      i,j : integer;
      Button : TButton;
      Rect : TRect;
    begin
      for i := 0 to StringGrid1.ColCount -1 do
        for j := 0 to StringGrid1.RowCount - 1 do
        begin
          Button := TButton.Create(StringGrid1);
          Button.Parent := Form1;
          Button.Caption := '查肉丝';
          Rect := Stringgrid1.CellRect(i,j);
          Button.SetBounds(Rect.Left+StringGrid1.Left+2,Rect.Top+StringGrid1.Top+2,Rect.Right-Rect.Left,Rect.Bottom-Rect.Top);
        end;end;end.
    object Form1: TForm1
      Left = 192
      Top = 106
      Width = 870
      Height = 640
      Caption = 'Form1'
      Color = clBtnFace
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -11
      Font.Name = 'MS Sans Serif'
      Font.Style = []
      OldCreateOrder = False
      PixelsPerInch = 96
      TextHeight = 13
      object StringGrid1: TStringGrid
        Left = 80
        Top = 56
        Width = 353
        Height = 321
        TabOrder = 0
      end
      object BitBtn1: TBitBtn
        Left = 480
        Top = 72
        Width = 75
        Height = 25
        Caption = 'BitBtn1'
        TabOrder = 1
        OnClick = BitBtn1Click
      end
    end