Autor Beitrag
Hendrik
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 324



BeitragVerfasst: So 09.03.03 17:59 
Hallo

Ich will aus einer Procedure (eine selbstgeschriebene, keine eines Objektes) eine andere (eines Popupmenüs) aufrufen.
Wenn ich aber N1menüeintragclick(sender); aufrufe sagt er, dass das Sender falsch ist. Wie kann ich denn die Procedure aufrufen, so dass es klappt?
derDoc
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 623

Win Vista Prof
D2007 Prof
BeitragVerfasst: So 09.03.03 18:16 
Übergib als Sender die Komponente deren Ereignis du benutzt:
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
procedure TForm1.Button2Click(Sender: TObject);
begin
  ShowMessage('Test');
end;

procedure TForm1.Klick;
begin
  Form1.Button2Click(Button2); 
  //hier als Sender den normalen Auslöser eintragen
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  Klick;
end;


Damit kannst du wenn der Button1 geklickt wird das machen, was passiert wenn Button2 geklickt wird. Ich glaube das etwas abgewandelt wolltest du.

_________________
MfG derDoc
There are only 10 types of people: those who understand binary and those who don't.
Popov
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 1655
Erhaltene Danke: 13

WinXP Prof.
Bei Kleinigkeiten D3Pro, bei größeren Sachen D6Pro oder D7
BeitragVerfasst: So 09.03.03 18:18 
//Edit

Falsch verstanden.

Neu

Versuchs mit

ausblenden Quelltext
1:
N1menüeintragclick(nil);					


Allerdings ist N1 eigentlich der Trenner.

Ich hoffe nicht, das du menüeintrag geschreiben hast. Ein Ü kann Delphi nicht verarbeiten.

_________________
Popov
Hendrik Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 324



BeitragVerfasst: Mo 10.03.03 16:13 
Danke es klappt mit nil !