Ahoj,
setkal jsem se z jednou takovou neprijemnou zalezitosti,
mam hlavni formular ve kterem mam jednoduchou proceduru pro spravu formularu ktere "vkladam" na hlavni formular
//AppLayout je umisten na hlivnim formulari do ktereho "vkladam" ostatni formulare
procedure TApp.FormManager(CloseForm,OpenForm:String;OnlyHide:Boolean = false);
begin
LastActiveForm:=OpenForm;
// OPEN FORM
if OpenForm = '' then begin
// nedelej nic ;-)
end
else if OpenForm = 'FAMain01' then begin
if NOT Assigned(FAMain01) then FAMain01 := TFUMain01.Create(Self);
FAMain01.FLayout.Parent:=AppLayout;
end;
// CLOSE FORM
if CloseForm = '' then begin
// nedelej nic ;-)
end
else if CloseForm = 'FAMain01' then begin
if Assigned(FAMain01) then begin
FAMain01.FLayout.Parent := nil;
if not OnlyHide then FreeAndNil(FAMain01);
end;
end;
Application.ProcessMessages;
ScaledLayout.Repaint
end;
problem ze ze pokud budu chtit FAMain01 zavrit pomoci tlacitka ktere je umisteno na nem tak mi to vyhodi exception do
procedure TControl.MouseClick(Button: TMouseButton; Shift: TShiftState; X, Y: Single);
begin
if AbsoluteEnabled and FPressed and not FDoubleClick and PointInObjectLocal(X, Y) then
begin
Click;
FPressed := False;
StartTriggerAnimation(Self, 'Pressed');
end;
end;
coz sice chapu jelikoz po
Click; jiz form prestane existovat a tim padem zbytek se nema na cem vykonat ale je to neprijemne :-/
Poradil by nekdo neco jednoducheho jak se teto neprijemnosti zbavit?