Sign in Join
Wiki copytemporary

TUpDown/zh CN: what changed

Revision 1 to 2. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
11**TUpDown** ![](/wiki-images/7/7d/Tupdown.png) 控件是两个按钮,附在别的可编辑控件上,通过 **Min** 和 **Max** 和 **Increment**属性来调整别的控件的内容 此控件包含两个箭头按钮,一个上一个下,也可以横向放置。 Min和Max 来设置控件的最大值和最小值,这里的值是 [[Smallint]]类型. [[Property]] **Position** 表示当前值. 加入属性 **ArrowKeys** 为 [[True]], 则可以通过键盘的上下键控制, 模拟上一个和下一个的点击.
22
3-**`Asscociate`**` 属性来连接其他可编辑控件,然后将命令发送到对应的控件。`
3+```text
4+Asscociate 属性来连接其他可编辑控件,然后将命令发送到对应的控件。
5+```
46
57在[[Common Controls tab]] 的 [[Component Palette]].
68
79## Runtime creating
810
911我们来看一个简单的样例 [[runtime]].\
1012首先添加一个 [[TEdit]] 控件.
1113
1214``` pascal
1315unit Unit1;
1416
1517{$mode objfpc}{$H+}
1618
1719interface
1820
1921uses
2022 Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, ComCtrls;
2123
2224type
2325
2426 { TForm1 }
2527
2628 TForm1 = class(TForm)
2729 Edit1: TEdit;
2830 procedure FormCreate(Sender: TObject);
2931 private
3032
3133 public
3234
3335 end;
3436
3537var
3638 Form1: TForm1;
3739
3840implementation
3941
4042{$R *.lfm}
4143
4244{ TForm1 }
4345
4446procedure TForm1.FormCreate(Sender: TObject);
4547var
4648 UpDown1: TUpDown;
4749begin
4850 UpDown1:= TUpDown.Create(Self);
4951 UpDown1.Parent:=Self;
5052 UpDown1.Min := -100;
5153 UpDown1.Max := 100;
5254 UpDown1.Associate := Edit1;
5355end;
5456
5557end.
5658```
5759
5860## see also
5961
6062- [[doc:lcl/comctrls/tupdown.html|TUpDown doc]]
6163- [[TSpinEdit]]
6264
6365---
6466*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](/wiki-contact).*

Back to history