Results 1 to 5 of 5

Thread: Calling a Form from a service

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2006
    Posts
    10

    Calling a Form from a service

    I am just starting VB.Net in order to make a Printing Service for an application.

    I have a service, and I was wondering how can I have it start a Windows Form UI when it is started?

    So, for example the Form class name is Form1, what code in onStart() will show the form when the service starts?

  2. #2
    Hyperactive Member OMITT3D's Avatar
    Join Date
    Mar 2006
    Posts
    368

    Re: Calling a Form from a service

    the form load event...?

  3. #3
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339

    Re: Calling a Form from a service

    Services are not meant to have a GUI (Graphic User Interface). A service will run under different user credentials and also runs even if no user is logged on.

    You should consider making a regular exe that runs in the background instead.

  4. #4

    Thread Starter
    New Member
    Join Date
    May 2006
    Posts
    10

    Re: Calling a Form from a service

    Interesting...

    Another question:

    Since Services can be made to start Manually, can I have a WindowsForm in which when the user selects some values, it passes those values to the service and start it?

  5. #5
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339

    Re: Calling a Form from a service

    Yes you could do that. You could also use remoting to communicate from a windows application to a windows service at runtime. Of course that solution is a bit of work.

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