borderAndreaVB free resources for Visual Basic developersborder

AndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincani

AndreaVB Home | News Home | Forum Home | Downloads | Register | Search | PM | Profile

Previous Topic (property page for OCX?)Next Topic (Run as...) New Topic Post Reply
AndreaVB OnLine : VB General : VB program running in the backgorund
Poster Resource
pcvillaluz
Level: Graduate

Registered: 04-10-2005
Posts: 9
icon VB program running in the backgorund

Good morning guys, i have another question. How can I run a VB program in the background?meaning I have a VB program that is supposed to run every 1 hour everyday, the problem is if i do this, the program keeps on popping on my screen every 1 hour. How can i make it run without the program popping on my screen?can i minimize it or put it in the system tray?pls help.

22-12-2005 at 01:06 AM
View Profile Send Email to User Show All Posts | Add Comment
VBhat
Level: Sage

Registered: 06-12-2005
Posts: 59
icon Re: VB program running in the backgorund

Hi pcvillaluz,

       You can just hide the form.

Example:

        form1.hide

22-12-2005 at 01:45 AM
View Profile Send Email to User Show All Posts | Add Comment
confusedbrat
Level: Sage

Registered: 29-08-2005
Posts: 64
icon Re: VB program running in the backgorund

you can hide the form but its better to do an unload me

coz if u just hide and then goto task manager u will see as many times it has run.. so at the end just do an Unload Me

22-12-2005 at 06:24 AM
View Profile Send Email to User Show All Posts | Add Comment
VBhat
Level: Sage

Registered: 06-12-2005
Posts: 59
icon Re: VB program running in the backgorund

To confusedbrat:

       He wants it to run in the background so I suggested to hide the form he can then put the "unload me" after 1 hr to unload the form. pcvillaluz, confusedbrat is right you should unload the form if you're not using it.

22-12-2005 at 07:16 AM
View Profile Send Email to User Show All Posts | Add Comment
steve_w
Level: Moderator


Registered: 18-04-2003
Posts: 1156
icon Re: VB program running in the backgorund

Does it need to have a form, can you just run it as a sub main.

Steve  

22-12-2005 at 09:29 AM
View Profile Send Email to User Show All Posts | Add Comment
VBhat
Level: Sage

Registered: 06-12-2005
Posts: 59
icon Re: VB program running in the backgorund

How can it be done using sub main?

23-12-2005 at 05:55 AM
View Profile Send Email to User Show All Posts | Add Comment
steve_w
Level: Moderator


Registered: 18-04-2003
Posts: 1156
icon Re: VB program running in the backgorund

Create a standard project

Add a module

In the module your start up code will be in a sub as below

Private Sub main()


End Sub


Now remove the form from the project

In the project properties check that the "startup object" is "Sub Main"

Now you have a form less project

Steve  

[Edited by steve_w on 23-12-2005 at 09:56 AM GMT]

23-12-2005 at 09:55 AM
View Profile Send Email to User Show All Posts | Add Comment
pcvillaluz
Level: Graduate

Registered: 04-10-2005
Posts: 9
icon Re: VB program running in the backgorund

thank you so much guys it's already working thank you for your help

27-12-2005 at 01:39 AM
View Profile Send Email to User Show All Posts | Add Comment
AndreaVB OnLine : VB General : VB program running in the backgorund
Previous Topic (property page for OCX?)Next Topic (Run as...)New Topic Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder