Recent

Author Topic: Form close, open  (Read 6700 times)

exdatis

  • Hero Member
  • *****
  • Posts: 668
    • exdatis
Form close, open
« on: January 24, 2011, 07:48:08 am »
  Hi all,
after 10th-12th form close-open, error msg: access violation.
onFormClose...
   CloseAction:= caFree;
   CurrentForm:= nil;
same error if:
onFormClose...
    CurrentForm.Free or FreeOnRelease.
on new form:
   CurrentForm:= TCurrentForm.Create(self);
   CurrentForm.Parent:= SomePanel;
   CurrentForm.Left:= 0;
   CurrentForm.Top:= 0;
   CurrentForm.Show;
Before new form:
  if SomePanel.ControlCount>2 then {logo and 'powered by lazarus' picture are Control[0], Control[1]}
    SomePanel .Controls[2].Destroy;
   Thanks.  %)

zeljko

  • Hero Member
  • *****
  • Posts: 1830
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: Form close, open
« Reply #1 on: January 24, 2011, 08:45:54 am »
procedure TMyForm.FormClose(Sender......);
begin
  CloseAction := caFree;
end;

exdatis

  • Hero Member
  • *****
  • Posts: 668
    • exdatis
Re: Form close, open
« Reply #2 on: January 24, 2011, 12:36:35 pm »
 ????
procedure TCurrentForm.FormClose(Sender: TObject; var CloseAction: TCloseAction
  );

Tobject, ????

 

TinyPortal © 2005-2018