Windows Vista Beta | WinVistaBeta.com - Message | VB.Net 2008 run project

November 20, 2008  
Subject: VB.Net 2008 run project
Group: microsoft.public.vstudio.general
Date: 8/12/2008 7:57:56 AM
From: "Ed Wyche" [Email Address Protection]

How do you create a formless program? I have a project now that has a
button to fire off an event. Is there away when you run the project to fire
the button click event when you run the project?


Back
Subject: Re: VB.Net 2008 run project
Group: microsoft.public.vstudio.general
Date: 8/12/2008 8:37:42 AM
From: Lloyd Sheen [Email Address Protection]

Ed Wyche wrote:
> How do you create a formless program? I have a project now that has a
> button to fire off an event. Is there away when you run the project to
> fire the button click event when you run the project?


A formless program is a "console" program. This type starts with a
"Main" subroutine.

If you just want to use what you have (a form) then on the form load
event simply call the routine that you want to execute.

LS

Back
Subject: Re: VB.Net 2008 run project
Group: microsoft.public.vstudio.general
Date: 8/12/2008 11:09:38 AM
From: "Ed Wyche" [Email Address Protection]

How would I have it fire that cmdButton from the Form_Load? Also how would
I allow switches from the command line. For example I would like a /r to
fire the command button without user interaction and if they run it without
/r it will bring up the form.

"Lloyd Sheen" <a@b.c> wrote in message
news:#4PAfFJ$IHA.1148@TK2MSFTNGP02.phx.gbl...
> Ed Wyche wrote:
>> How do you create a formless program? I have a project now that has a
>> button to fire off an event. Is there away when you run the project to
>> fire the button click event when you run the project?
>
>
> A formless program is a "console" program. This type starts with a "Main"
> subroutine.
>
> If you just want to use what you have (a form) then on the form load event
> simply call the routine that you want to execute.
>
> LS


Back
Subject: Re: VB.Net 2008 run project
Group: microsoft.public.vstudio.general
Date: 8/12/2008 2:19:21 PM
From: Lloyd Sheen [Email Address Protection]

Ed Wyche wrote:
> How would I have it fire that cmdButton from the Form_Load? Also how
> would I allow switches from the command line. For example I would like
> a /r to fire the command button without user interaction and if they run
> it without /r it will bring up the form.
>
> "Lloyd Sheen" <a@b.c> wrote in message
> news:#4PAfFJ$IHA.1148@TK2MSFTNGP02.phx.gbl...
>> Ed Wyche wrote:
>>> How do you create a formless program? I have a project now that has
>>> a button to fire off an event. Is there away when you run the
>>> project to fire the button click event when you run the project?
>>
>>
>> A formless program is a "console" program. This type starts with a
>> "Main" subroutine.
>>
>> If you just want to use what you have (a form) then on the form load
>> event simply call the routine that you want to execute.
>>
>> LS
>


First off there is no more cmdButton in a console program. I think you
are only using the button to start the process right?

If so the code you run on the button click is the code you run on the
load of the application.

Now if you want to be able to use a windows form for this and control it
with commandline switches , you can get the command line switches from
System.Environment.CommandLine.

Take all the code from the button click event and put it into a
subroutine. Then in the button click event call the subroutine. If when
you parse the commandline parameters and you see your combination to
auto-click , just call your subroutine.

LS

Back