Autor Beitrag
Hagbard
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 142

Win XP Home / Pro
D7.1 Architekt
BeitragVerfasst: Mo 07.06.04 13:13 
Hallo zusammen,

ich habe folgendes Problem:

Ich schreibe mir gerade eine Art TouchScreen Freundliche Kalender Komponente. Dafür habe Ich von TPanel abgeleitet. Auf meinem Panale habe Ich nun eine variable Anzahl von Buttons, die später jeweils einen Monat, oder einen Tag representieren sollen.

Ich kann meinen Buttons jetzt ein OnClick Event zuweisen, ABER wie kann Ich das OnClick an mein Panel weiterreichen, so das Ich nachher Auswerten kann, welchen Button Ich gedrückt habe?

Leider fehlt mir momentan noch jeder Ansatz dazu.... Wäre nett, wenn mir jemand auf die Sprünge helfen könnte.....

Viele Grüße,
Christin

_________________
I haven't failed, I just found 10,000 ways that won't work!
Udontknow
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2596

Win7
D2006 WIN32, .NET (C#)
BeitragVerfasst: Mo 07.06.04 13:18 
Hallo!

Indem du einfach die Prozedur Click übersteuerst und dort eine Prozedur des Panels vom Button aufrufen lässt.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
procedure TMyPanelButton.Click;
begin
  TMyPanel(Parent).ButtonClicked(Self);
  inherited;
end;

procedure TMyPanel.ButtonClicked(Button:TMyPanelButton);
begin
  ShowMessage('Button '+Button.Name+' wurde gedrückt!');
end;


Cu,
Udontknow
Hagbard Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 142

Win XP Home / Pro
D7.1 Architekt
BeitragVerfasst: Mo 07.06.04 15:43 
Super!

Das Probier Ich gleich mal aus....

Viele Dank,
Christian

_________________
I haven't failed, I just found 10,000 ways that won't work!