[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 944
  • Last Modified:

problem with Application.ShowMainForm

hi,

in my project file i have this line of code:
Application.ShowMainForm := False;
yes, i don't want my program to popup when it starts.

the problem is that when i click my icon in the system tray and my program pops up on the screen, my components are not visible. only my speedbuttons are visible.

if i remove the line:
Application.ShowMainForm := False;
every component becomes visible but as i said, i don't want my program to popup when it starts.

/saam
0
saam
Asked:
saam
  • 2
  • 2
1 Solution
 
rwilson032697Commented:
When the user clicks on the system tray button for your application set ShowMainForm to true again.

Cheers,

Raymond.
0
 
saamAuthor Commented:
thanks for the quick response  rwilson, but i have tried to put ShowMainForm to true (in several different places of my project), it still won't work.

my mainform shows up when i click the system tray button, but only the form plus my speedbuttons are visible, not my richedit and my standard buttons.

/saam

0
 
interCommented:
Try setting Visible to True before setting  
Form1.Visible := true;
Application.ShowMainForm := true;

0
 
saamAuthor Commented:
i thought i had tried everything but that was it!
thanks a lot!
/saam
0
 
interCommented:
You are welcome,
I have realized the thing by directly inspecting TApplication source...(you can always analyze the source if you have delphi professional or higher)
c.u. igor
0

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now