I have a Visual basic program(standard exe), which does some file operations. I dont need the form to be visible at all.How can I hide it programatically so that the .exe just executes and terminates.
thanks,
lijo
Printable View
I have a Visual basic program(standard exe), which does some file operations. I dont need the form to be visible at all.How can I hide it programatically so that the .exe just executes and terminates.
thanks,
lijo
1. To hide a form, you can use either
hide me
or
hide formname
2. if you do not need forms at all, you do no thave to have a form in your program. remove all your forms ( if you have any). make sure that you use sub main() for your code. Also make sure that you go to "Project Properties" under "Project" menu bar and select "Sub Main" under "Start up Objects"
You are all set.
well that idiot that posted didn't explain for **** so heres how. to hide the form just put in Me.Hide. And then under form load, put in whatever you wanted to do with the file operations, and then at the end, just type in end
You don't need to add a form to a VB program at all !
In the project->properties menu, set the startup object to 'Sub Main()' and then add a BAS Module to your program.
eg.
option Explicit
'
Sub Main()
'
DoSomeLengthyProcessingHere
'
End Sub
'
The program will just execute that sub (and any others you call from it obviously) and exit afterwards.
Chris Eastwood
CodeGuru - the website for developers
http://codeguru.developer.com/vb
>well that idiot that posted didn't explain for **** so heres how.
What idiot ?
Why's he an idiot ?
What right do you have calling anyone an idiot ?
>to hide the form just put in Me.Hide. And then under form load, put in whatever you wanted to do with the file operations, and then at the end, just type in end
Use 'End' to end a program ? not unless you want to have memory leaks etc in your program, try a 'Unload Me' statement instead
Chris Eastwood
CodeGuru - the website for developers
http://codeguru.developer.com/vb