Autor Beitrag
janis
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 32


D7 Prof
BeitragVerfasst: Di 09.11.04 09:49 
Hallo
ich habe folgendes Probel :
Auf meinem Formular habe ich verschiedenen Buttons, welche diverse Programmschritte
ausführen. Nun möchte ich, wenn ich Button 1 drücke, dass zB. die Programmschritte, welche
ich bei Button 3 programmiert habe ausgeführt werden.
Meine Frage: Wie lautet der Befehl um einem Button ohne darauf zu klicken aus zu führen
Vielen Dank
janis
:oops:


Moderiert von user profile iconTino: Topic aus Sonstiges verschoben am Do 11.11.2004 um 16:55
UGrohne
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Veteran
Beiträge: 5502
Erhaltene Danke: 220

Windows 8 , Server 2012
D7 Pro, VS.NET 2012 (C#)
BeitragVerfasst: Di 09.11.04 09:52 
Wenn Du doppelt auf einen BUtton klickst, dann wird ja eine Prozedur erzeugt, die beim Eintreten des Click-Ereignisses ausgeführt wird. Diese kannst Du auch selbst aufrufen. Schau Dir einfach den Prozedurnamen der Button3-Prozedur an und ruf diese auf. Z.B. wenn der Button Button3 heißt, wird die Prozedur wohl so aufgerufen werden:
ausblenden Delphi-Quelltext
1:
Button3Click(nil);					

Der Parameter ist Sender, wird aber meist nicht gebraucht, deswegen übergebe ich nichts (nil), Du kannst aber auch Self reinschreiben ;-). Aber das geht jetzt hier zu weit.
Stübi
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 331

Win XP, Win 2000, Win ME
D5 Ent, D7 Prof, D2005 PE, C#
BeitragVerfasst: Di 09.11.04 09:53 
ausblenden Delphi-Quelltext
1:
ButtonClick(self);					


Gruss Stübi

[edit]Mist war schon wieder jemand schneller[/edit]

_________________
Neun von zehn Stimmen in meinen Kopf sagen, dass ich nicht verrückt sei. Die zehnte summt die Tetrismelodie.
Motzi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2931

XP Prof, Vista Business
D6, D2k5-D2k7 je Prof
BeitragVerfasst: Di 09.11.04 10:49 
Alternativ dazu gibts auch die Methode "Click()":
ausblenden Delphi-Quelltext
1:
Button3.Click;					

Damit wird immer die aktuell mit dem OnClick-Ereignis verbundene Methode aufgerufen...

_________________
gringo pussy cats - eef i see you i will pull your tail out by eets roots!
janis Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 32


D7 Prof
BeitragVerfasst: Do 11.11.04 10:51 
Vielen Dank funktioniert !
Gruss Janis :D