Sign in Join
Wiki copytemporary

TUpDown/fi

English · Français · Suomi · Русский · 中文(中国)

TUpDown-komponentti 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 numeroita. Property Position edustaa valittua arvoa. Jos ominaisuus ArrowKeys on 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 komponenttipaletin Common Controls -välilehdeltä.

Ajonaikainen luonti

Tässä on yksinkertainen esimerkki TUpDown-komponentin luomisesta ajonaikaisesti.
Luo ensin lomake ja laita siihen TEdit-komponentti.

pascal
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.

Katso myös


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.

Revision 1, last changed by WikiArchive .

Edited on wiki.freepascal.org by 1 person, 2019

From the official wiki's backup of 26 May 2024: who edited this page there, and when. Edits made there after that date were not recorded, and the earlier versions are not shown here; the main page says why.

WhenWhoWhat changed
DjzepiCreated page
Djzepi
Djzepi

Talk about this page

Nobody has opened a bench for this page yet. Sign in to open one.