TUpDown/zh CN
English · Français · Suomi · Русский · 中文(中国)
TUpDown
控件是两个按钮,附在别的可编辑控件上,通过 Min 和 Max 和 Increment属性来调整别的控件的内容 此控件包含两个箭头按钮,一个上一个下,也可以横向放置。 Min和Max 来设置控件的最大值和最小值,这里的值是 Smallint类型. Property Position 表示当前值. 加入属性 ArrowKeys 为 True, 则可以通过键盘的上下键控制, 模拟上一个和下一个的点击.
Asscociate 属性来连接其他可编辑控件,然后将命令发送到对应的控件。在Common Controls tab 的 Component Palette.
Runtime creating
我们来看一个简单的样例 runtime.
首先添加一个 TEdit 控件.
unit Unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, ComCtrls;
type
{ TForm1 }
TForm1 = class(TForm)
Edit1: TEdit;
procedure FormCreate(Sender: TObject);
private
public
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1.FormCreate(Sender: TObject);
var
UpDown1: TUpDown;
begin
UpDown1:= TUpDown.Create(Self);
UpDown1.Parent:=Self;
UpDown1.Min := -100;
UpDown1.Max := 100;
UpDown1.Associate := Edit1;
end;
end.see also
From the Free Pascal wiki, page "TUpDown/zh CN", as it stood on 2020-04-23 after a change by TyphonFinger, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.