菜尿请教:如何给GroupBox加上滚动条? 调节它的自动适应属性TCheckListBox更好用 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 //pasunit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, Grids, ValEdit, StdCtrls, ExtCtrls;type TForm1 = class(TForm) GroupBox1: TGroupBox; Panel1: TPanel; ScrollBar1: TScrollBar; Panel2: TPanel; ScrollBar2: TScrollBar; Edit1: TEdit; Edit2: TEdit; Memo1: TMemo; procedure ScrollBar1Change(Sender: TObject); procedure FormShow(Sender: TObject); procedure ScrollBar2Change(Sender: TObject); private { Private declarations } public { Public declarations } end;var Form1: TForm1;implementation{$R *.dfm}uses Math;procedure TForm1.ScrollBar1Change(Sender: TObject);begin Panel2.Top := - TScrollBar(Sender).Position;end;procedure TForm1.FormShow(Sender: TObject);begin ScrollBar1.Min := 0; ScrollBar1.Max := Max(Panel2.Height - Panel2.Parent.ClientHeight, 0); ScrollBar2.Min := 0; ScrollBar2.Max := Max(Panel2.Width - Panel2.Parent.ClientWidth, 0); Panel2.Top := 0; Panel2.Left := 0;end;procedure TForm1.ScrollBar2Change(Sender: TObject);begin Panel2.Left := - TScrollBar(Sender).Position;end;end.//dfmobject Form1: TForm1 Left = 192 Top = 107 Width = 544 Height = 375 Caption = 'Form1' Color = clBtnFace Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -11 Font.Name = 'MS Sans Serif' Font.Style = [] OldCreateOrder = False OnShow = FormShow PixelsPerInch = 96 TextHeight = 13 object GroupBox1: TGroupBox Left = 152 Top = 144 Width = 185 Height = 105 Caption = 'GroupBox1' TabOrder = 0 object Panel1: TPanel Left = 2 Top = 15 Width = 165 Height = 72 Align = alClient BevelOuter = bvNone TabOrder = 0 object Panel2: TPanel Left = 0 Top = 0 Width = 290 Height = 233 BevelOuter = bvNone TabOrder = 0 object Edit1: TEdit Left = 24 Top = 64 Width = 121 Height = 21 TabOrder = 0 Text = 'Edit1' end object Edit2: TEdit Left = 24 Top = 24 Width = 121 Height = 21 TabOrder = 1 Text = 'Edit2' end object Memo1: TMemo Left = 160 Top = 24 Width = 185 Height = 89 Lines.Strings = ( 'Memo1') TabOrder = 2 end end end object ScrollBar1: TScrollBar Left = 167 Top = 15 Width = 16 Height = 72 Align = alRight Kind = sbVertical PageSize = 0 TabOrder = 1 OnChange = ScrollBar1Change end object ScrollBar2: TScrollBar Left = 2 Top = 87 Width = 181 Height = 16 Align = alBottom PageSize = 0 TabOrder = 2 OnChange = ScrollBar2Change end endend 请大侠救命,请问怎么才能实现每秒抓屏20-30次 进来!!抢分呀-----这个问题很急,帮顶也有分,回答问题的分数绝不让你失望! 有个用DELPHI做的小项目。有兴趣想要做的可以和我联系! 请教:在stringgrid中修改单元格的问题 dbgrid的问题??急用呀?? 大家帮我看看错在哪里? 请教!怎么检验edit中数据是float类型用什么函数? 怎样让程序启动的更快!? 请教一个简单的问题。 请问如何访问ACCESS表当前记录号? 急:为什么都用uses包含了,还是报告说没定义变量? 注册表中如何建新的主键?30分
unit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Grids, ValEdit, StdCtrls, ExtCtrls;type
TForm1 = class(TForm)
GroupBox1: TGroupBox;
Panel1: TPanel;
ScrollBar1: TScrollBar;
Panel2: TPanel;
ScrollBar2: TScrollBar;
Edit1: TEdit;
Edit2: TEdit;
Memo1: TMemo;
procedure ScrollBar1Change(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure ScrollBar2Change(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}uses
Math;procedure TForm1.ScrollBar1Change(Sender: TObject);
begin
Panel2.Top := - TScrollBar(Sender).Position;
end;procedure TForm1.FormShow(Sender: TObject);
begin
ScrollBar1.Min := 0;
ScrollBar1.Max := Max(Panel2.Height - Panel2.Parent.ClientHeight, 0);
ScrollBar2.Min := 0;
ScrollBar2.Max := Max(Panel2.Width - Panel2.Parent.ClientWidth, 0);
Panel2.Top := 0;
Panel2.Left := 0;
end;procedure TForm1.ScrollBar2Change(Sender: TObject);
begin
Panel2.Left := - TScrollBar(Sender).Position;
end;end.//dfm
object Form1: TForm1
Left = 192
Top = 107
Width = 544
Height = 375
Caption = 'Form1'
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = False
OnShow = FormShow
PixelsPerInch = 96
TextHeight = 13
object GroupBox1: TGroupBox
Left = 152
Top = 144
Width = 185
Height = 105
Caption = 'GroupBox1'
TabOrder = 0
object Panel1: TPanel
Left = 2
Top = 15
Width = 165
Height = 72
Align = alClient
BevelOuter = bvNone
TabOrder = 0
object Panel2: TPanel
Left = 0
Top = 0
Width = 290
Height = 233
BevelOuter = bvNone
TabOrder = 0
object Edit1: TEdit
Left = 24
Top = 64
Width = 121
Height = 21
TabOrder = 0
Text = 'Edit1'
end
object Edit2: TEdit
Left = 24
Top = 24
Width = 121
Height = 21
TabOrder = 1
Text = 'Edit2'
end
object Memo1: TMemo
Left = 160
Top = 24
Width = 185
Height = 89
Lines.Strings = (
'Memo1')
TabOrder = 2
end
end
end
object ScrollBar1: TScrollBar
Left = 167
Top = 15
Width = 16
Height = 72
Align = alRight
Kind = sbVertical
PageSize = 0
TabOrder = 1
OnChange = ScrollBar1Change
end
object ScrollBar2: TScrollBar
Left = 2
Top = 87
Width = 181
Height = 16
Align = alBottom
PageSize = 0
TabOrder = 2
OnChange = ScrollBar2Change
end
end
end