|
-
Feb 4th, 2008, 08:56 PM
#1
Thread Starter
New Member
Run Program In Background?
Hey
I want to make a program to run in background but keep its icon in the taskbar and when user clicks on the icon it will show the program?
Thanks :]
-
Feb 4th, 2008, 09:23 PM
#2
Re: Run Program In Background?
When you say:
keep its icon in the taskbar
do you actually mean the big button on the task bar or the little icon in the system tray, i.e. beside the clock? If you mean the system tray then you just add a NotifyIcon to your form, set its Icon property and make it Visible. You can then Hide and Show the form at will.
-
Feb 4th, 2008, 10:08 PM
#3
Thread Starter
New Member
Re: Run Program In Background?
 Originally Posted by jmcilhinney
When you say:do you actually mean the big button on the task bar or the little icon in the system tray, i.e. beside the clock? If you mean the system tray then you just add a NotifyIcon to your form, set its Icon property and make it Visible. You can then Hide and Show the form at will.
I Yes System Tray next to the clock.
I tried adding a NotifyIcon to the form and I added Me.hide() but that didnt work form still showed?
-
Feb 4th, 2008, 10:39 PM
#4
Re: Run Program In Background?
That would be because you called Me.Hide before the form was shown. You can't hide something that hasn't been shown and if it gets shown after you call Hide then calling Hide is pointless.
If you don't want a form to be displayed when your app is started up then you need to set its WindowState to Minimized and its ShowInTaskbar to False. The form will then not be seen by the user but it is still, strictly speaking, visible. You then handle the Shown event of the form, which is raised AFTER the form has been shown, and call Hide there. Now the form will be truly not visible.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|