Results 1 to 4 of 4

Thread: Form Question

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 2007
    Posts
    63

    Question Form Question

    How can I load a form and allow it to run it's code in the form load but keep it not visible. I want it to do what it needs to but but not display.

    Thanks for the help.

    Mythos

  2. #2
    Wait... what? weirddemon's Avatar
    Join Date
    Jan 2009
    Location
    USA
    Posts
    3,826

    Re: Form Question

    A Windows Form is used to express visible data to the User. If you don't require a GUI, then you should make a Windows Service.
    CodeBank contributions: Process Manager, Temp File Cleaner

    Quote Originally Posted by SJWhiteley
    "game trainer" is the same as calling the act of robbing a bank "wealth redistribution"....

  3. #3
    Fanatic Member Megalith's Avatar
    Join Date
    Oct 2006
    Location
    Secret location in the UK
    Posts
    879

    Re: Form Question

    form1.hide() then use form1.show() when you wish to see it

    edit. weirddemon is right tho a service would be better, my example works well with multiple forms
    If debugging is the process of removing bugs, then programming must be the process of putting them in.

  4. #4
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: Form Question

    Just because you don't need a GUI does not mean you should make a windows service.

    Services aren't just GUIless executables. There is more to it than that.

    You can just make a winforms application without any forms, and just create a public sub main() to be the entry point of your exe, or you can use the application framework and run whatever code you want to run before any form is shown in the applications startup event.

    Of course what solution you are going to want to use will depend on IF you do ever, at some point, want to show a form or not.

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