Need Help

Need Help
I have write following code to stop duplicate forms to be open

but i am getting error as shown below any one can tell me why ?

procedure NewForm(InstanceClass:TComponentClass; var Referance);

Procedure TMainFrm.NewForm(InstanceClass: TComponentClass; var Referance);
var i: Integer;
begin

for i := 0 to MDIChildCount-1 do
if MDIChildren[i] is InstanceClass then
begin
MDIChildren[i].Show;
MDIChildren[i].WindowState := wsMaximized;
Exit;
end;
Application.CreateForm(InstanceClass, Referance);
end;

Error Message
[dcc32 Error] MainFrm_Unit.pas(133): E2014 Statement expected, but expression of type 'TAction' found

Comments

  1. Jude De Silva And this is a VCL application? Weird. Try a complete build. Otherwise try this code in a new project and see if it compiles then.

    ReplyDelete
  2. What if you postmessage the window instead of manipulating it directly?

    ReplyDelete

Post a Comment