Also mein Problem ist folgendes:
Ich soll für Informatik ein "Fangmich"-Spiel mit Panels programmieren...
Das Panel, auf das ich dann klicke wird nicht zerstört,
Fehler: "AccesViolation"
Delphi-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25:
| procedure Tmainform.panelcreate; begin pan := TPanel.Create(mainform); pan.Parent := mainform; pan.Name := 'pan' + IntToStr(pan_anzahl); pan.Width := 40; pan.Height := 40; pan.Caption := 'F'; pan.Color := clYellow; pan.Left := random(mainform.Width-50); pan.Top := random(mainform.Height-60); pan.OnClick := panelclose; pan.Show; inc(pan_anzahl); end;
procedure Tmainform.panelclose(Sender: TObject); begin TPanel(Sender).Free; inc(punkte); setpoints; dec(pan_anzahl); end; |
Ich komm einfach nicht weiter
