Autor Beitrag
Palmm130
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 26



BeitragVerfasst: Mi 31.01.07 12:23 
Hallo,
ich habe für den Informatik-Unterricht ein Programm geschrieben,
wo über das Create-Attribut Panels erzeugt werden, meine Frage ist:
Wie mache ich, wenn ich diese Panels anklicke, dass diese zerstürt (Destroy) werden ?
ich denke mal, das geht über das OnClick-Attribut, habe nur keine Ahnung, wie ich das komninieren soll ^^

danke schonmal
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10185
Erhaltene Danke: 1261

W11x64
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Mi 31.01.07 12:32 
Moin und :welcome: im Forum!

user profile iconPalmm130 hat folgendes geschrieben:
wo über das Create-Attribut Panels erzeugt werden,

Mir scheint, du verwechselst hier "Methode" mit "Attribut" (=Eigenschaft), oder? ;)

user profile iconPalmm130 hat folgendes geschrieben:
meine Frage ist:
Wie mache ich, wenn ich diese Panels anklicke, dass diese zerstürt (Destroy) werden ?
ich denke mal, das geht über das OnClick-Attribut, habe nur keine Ahnung, wie ich das komninieren soll

Du kannst VCL-Objekte nicht in ihren Methoden freigeben, das wird mit einer Exception bestraft. :mahn: :D

Leider ist das nicht ganz soo einfach, ein Steuerelement durch ein (eigenes) Ereignis freizugeben. :? Reicht es nicht, wenn du das Panel durch einen Klick unsichtbar (.Visible := FALSE) machst? :gruebel:

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.
Palmm130 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 26



BeitragVerfasst: Mi 31.01.07 12:42 
Visible:=False wäre auch ok, wie sähe das dann aus ?
also Codemäßig ?

[...]
Klickwegpanel:=TPanel.Create(Self);
Klickwegpanel.Parent:=Form1;
{Hier sollte das mit dem OnClick->Visible hin}
[...]

danke schonmal ^^

ich meinte Methode :P
Coder
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1383
Erhaltene Danke: 1

WinXP
D2005 PE
BeitragVerfasst: Mi 31.01.07 12:52 
Du schreibst die OnClick Prozedur und fügst sie beim erstellen dem Panel zu:
ausblenden Delphi-Quelltext
1:
Klickwegpanel.OnClick := DeineOnClickProcedure;					


MfG
Palmm130 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 26



BeitragVerfasst: Mi 31.01.07 12:55 
lol, ok - danke ;)
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10185
Erhaltene Danke: 1261

W11x64
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Mi 31.01.07 12:56 
Moin!

Schau mal hier, vielleicht kannst du damit was anfangen. ;)

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.