CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 1999
    Posts
    57

    urgent::How to hide the form?

    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



  2. #2
    Join Date
    Dec 1999
    Posts
    20

    Re: urgent::How to hide the form?

    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.



  3. #3
    Join Date
    Feb 2000
    Location
    garden grove, california
    Posts
    64

    Re: urgent::How to hide the form?

    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






  4. #4
    Join Date
    May 1999
    Location
    Oxford UK
    Posts
    1,459

    Re: urgent::How to hide the form?

    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

  5. #5
    Join Date
    May 1999
    Location
    Oxford UK
    Posts
    1,459

    Re: urgent::How to hide the form?

    >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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured