Sign in Join
Wiki copytemporary

TUpDown/fi: what changed

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

Title: TUpDown/fi

OldNewLine
1+**TUpDown**-komponentti ![](/wiki-images/7/7d/Tupdown.png) on kahden painikkeen ohjaus, joka auttaa lisäämään tai pienentämään jonkin verran arvoa sen **Min**- ja **Max**- ja **Increment**-ominaisuuksien perusteella. TUpDown-komponentti näkyy kahtena nuolipainikkeena jotka ovat ylöspäin (seuraava) ja alaspäin (edellinen). Min- ja Max-ominaisuuksia käytetään määrittämään TUpDownin vähimmäis- ja maksimiarvot. TUpDown-komponentin arvot ovat [[Smallint/fi|Smallint]] numeroita. [[Property/fi|Property]] **Position** edustaa valittua arvoa. Jos ominaisuus **ArrowKeys** on [[True/fi|true]], TUpDown-komponenttia voidaan käyttää näppäimistön nuolinäppäimillä, jotka simuloivat seuraavan tai edellisen painikkeen klikkausta. **Asscociate**-ominaisuus voi linkittää sen johonkin muuhun ohjaukseen, joka saa arvonmuutoksen ohjeen TUpDownilta. TUpDown löytyy [[Component Palette/fi|komponenttipaletin]] [[Common Controls tab/fi|Common Controls]] -välilehdeltä.
2+
3+## Ajonaikainen luonti
4+
5+Tässä on yksinkertainen esimerkki TUpDown-komponentin luomisesta [[runtime/fi|ajonaikaisesti]].\
6+Luo ensin lomake ja laita siihen [[TEdit/fi|TEdit]]-komponentti.
7+
8+``` pascal
9+unit Unit1;
10+
11+{$mode objfpc}{$H+}
12+
13+interface
14+
15+uses
16+ Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, ComCtrls;
17+
18+type
19+
20+ { TForm1 }
21+
22+ TForm1 = class(TForm)
23+ Edit1: TEdit;
24+ procedure FormCreate(Sender: TObject);
25+ private
26+
27+ public
28+
29+ end;
30+
31+var
32+ Form1: TForm1;
33+
34+implementation
35+
36+{$R *.lfm}
37+
38+{ TForm1 }
39+
40+procedure TForm1.FormCreate(Sender: TObject);
41+var
42+ UpDown1: TUpDown;
43+begin
44+ UpDown1:= TUpDown.Create(Self);
45+ UpDown1.Parent:=Self;
46+ UpDown1.Min := -100;
47+ UpDown1.Max := 100;
48+ UpDown1.Associate := Edit1;
49+end;
50+
51+end.
52+```
53+
54+## Katso myös
55+
56+- [[doc:lcl/comctrls/tupdown.html|TUpDown doc]]
57+- [[TSpinEdit/fi|TSpinEdit]]
58+
59+---
60+*From the Free Pascal wiki, page "TUpDown/fi", as it stood on 2019-11-21 after a change by Djzepi, 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