Autor Beitrag
steppenwolf
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 38



BeitragVerfasst: Di 05.07.05 15:58 
Hallo allerseits,

ich möchte zwecks Erhöhung bzw. Verringerung eines Wertes einen Spinbutton einsetzen.
Problem: Wie kann ich den 'nach-oben' bzw. 'nach-unten' - Klick auswerten?

Ich habe folgendes versucht:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
...
if Form1.SpinButton1.OnDownClick then i := i - 1;  // Verringerung
if Form1.SpinButton1.OnUpClick then i := i + 1;    // Erhöhung
...


Leider funktioniert das nicht, da hier ein Syntaxproblem gemeldet wird.

Für Eure Hinweise vielen Dank und auf bald ...
steppenwolf.

Moderiert von user profile iconraziel: Delphi-Tags hinzugefügt und BBCodes aktiviert.
Keldorn
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 2266
Erhaltene Danke: 4

Vista
D6 Prof, D 2005 Pro, D2007 Pro, DelphiXE2 Pro
BeitragVerfasst: Di 05.07.05 16:09 
Hallo

der code gehört doch in die ereignisse selbst:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
procedure TForm1.SpinButton1DownClick(Sender: TObject);
begin
  dec(i);       //I:=i-1;
end;

procedure TForm1.SpinButton1UpClick(Sender: TObject);
begin
  inc(i);
end;


wobei du dir evtl auch das spinedit anschauen solltest, das steht der Wert gleich im Edit un das hoch und runter geht von alleine.

Mfg Frank

_________________
Lükes Grundlage der Programmierung: Es wird nicht funktionieren.
(Murphy)
steppenwolf Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 38



BeitragVerfasst: Mi 06.07.05 13:31 
Hallo Frank,

vielen Dank, es hat geklappt!

Ich habe auch das Spinedit verwendet, da es eine elegantere Variante ist.

Auf bald ...
steppenwolf.