Autor Beitrag
Wuschl
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 39



BeitragVerfasst: Mo 02.12.02 15:11 
Hallo Miteinander ;)

Meine Unfähigkeit hat mich leider zu meinem nächsten Problem getrieben :-). Ich habs auch schon mit der Suche probiert aber leider nichts gefunden.

Also mein Problem ist: Ich habe drei Spinedits die einen maximalen wert von 100 haben. Also wenn ich jetzt Spinedit1 auf 80 setzt sollen 2 und 3 automatisch 10 haben usw. Also einfach so das alle 3 zusammen nie über 100 kommen! Hoffe auf eure Hilfe ;-)

Gruß
Wuschl
tommie-lie
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 4373

Ubuntu 7.10 "Gutsy Gibbon"

BeitragVerfasst: Mo 02.12.02 16:19 
na, das kriegt man doch mit ausprobieren hin!
Schau mal im ObjektInspector bei den Events des SpinEdits. Da gibt's ein schönes, das nennt sich OnChange. Klingelt's?
Wenn nicht, klick einmal drauf, drück F1 und lies den Text, der da wundersamerweise erscheint ;-)

_________________
Your computer is designed to become slower and more unreliable over time, so you have to upgrade. But if you'd like some false hope, I can tell you how to defragment your disk. - Dilbert
Wuschl Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 39



BeitragVerfasst: Di 03.12.02 08:52 
mhmh ok hast recht ;-)
allerdings wenn ich jetzt bei allen dreien das onmove event belege geht nichts mehr *g*

Gruß
Wuschl
Wuschl Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 39



BeitragVerfasst: Di 03.12.02 09:32 
Ich mach jetzt z.B bei Spinedit3 im OnChange Event folgendes:
ausblenden Quelltext
1:
2:
Spinedit1.Value:=(100-Spinedit3.Value)/2;
     Spinedit2.Value:=(100-spinedit3.Value)/2;


Wie kann ich jetzt verhindern das beim click von Spinedit3 auch der OnChange Event von 1 und 2 (der Code ist ja ungefähr gleich) ausgelöst wird?

gruß
Wuschl
LCS
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1305
Erhaltene Danke: 1

WIN 7, WIN 8
Delphi XE5, Delphi XE, Delphi 2007
BeitragVerfasst: Di 03.12.02 10:17 
Hi
du könntest z. B. innerhalb der Routine die Ereignissbehandlung vorübergehend abschalten:
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
  Spinedit1.OnChange := nil;
  Spinedit2.OnChange := nil;

  Spinedit1.Value:=(100-Spinedit3.Value)/2; 
  Spinedit2.Value:=(100-spinedit3.Value)/2;

  Spinedit1.OnChange := Spinedit1OnChange; //oder wie deine Routine heisst
  Spinedit2.OnChange := Spinedi2OnChange;


Gruss Lothar

_________________
Der BH ist für die Brust, der Plan ist für'n Ar...
Wuschl Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 39



BeitragVerfasst: Di 03.12.02 10:20 
Ja danke das wär ne Möglichkeit, ich hab jetzt halt einfach jeweils den OnUp und OnDown Event belegt!

Gruß
Wuschl