Click to See Complete Forum and Search --> : urgent::How to hide the form?
Lijo
February 24th, 2000, 07:31 PM
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
Dhirendra123
February 24th, 2000, 08:56 PM
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.
The Matrix
February 24th, 2000, 10:33 PM
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
Chris Eastwood
February 25th, 2000, 02:55 AM
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
Chris Eastwood
February 25th, 2000, 02:58 AM
>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
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.