超难问题!!!!请问如何实现 "按钮表格" 的功能 (有图片) !!!!!!!
要求能动态生成 多个 按钮, 并把这些按钮像表格一样排列!!! 要自动显示滚动条!!!! 虽然可以用 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
要求能动态生成 多个 按钮, 并把这些按钮像表格一样排列!!! 要自动显示滚动条!!!! 虽然可以用 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
解决方案 »
- 神啊!救救我吧.!移动短信网关 arg 文件配置
- 关于对ORACLE数据库触发器的操作
- 绝对挑战!!!!请问怎样将FastReport报表导出为PDF文件?用虚拟打印机除外!该出手时就出手!!谢谢!!!
- 急!!dbgrid1中,怎样把ComboBox1嵌在字段(日期)所对应的第一个单元格中?
- 那我怎么样判断一个时间在某两个时间范围内? 在线,答对立即结贴~~~~~~
- 求能在Delphi6下编译的RSA或DES加密算法源程序
- Quick Report 无法显示数据
- delphi的三方控件怎么安装?
- 如何做到程序运行条件不满足是立即退出?
- 怎样做一个段超连接文字?
- 怎样写下列问题的SQL语句?
- ACCESS与SQL不在同一台机器上,如何导入数据?
[email protected]
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