After the system opens I want to hide the main form.

Hello guys

I have a component named RxTrayIcon that sends my application to system tray. My application is on the start, when the computer is turned on my system is loaded . What I want is after loading my system is to hide it. When I click on close system I run this code:

  RxTrayIcon1.Active := True;
  Fmenu.Hide;
  CanClose := False

How could I do this after loading it.

Thanks
LVL 1
hidrauAsked:
Who is Participating?
 
mikelittlewoodCommented:
How about dropping a timer onto your form and enabling it after load. Set the timer to a couple of seconds then call that exact code within the timer event. Ive used this way many times.
0
 
mikelittlewoodCommented:
procedure TForm1.Timer1Timer(Sender: TObject);
begin
  Timer1.Enabled := False;
  RxTrayIcon1.Active := True;
  Fmenu.Hide;
end;
0
 
DragonSlayerCommented:
Hi, you can also do this in your Project's code:

Application.ShowMainForm := False;
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.