Three indicators of the OP's chosen programming language in the 1-line
code presented :

1. No semicolon. Indicates VB.
2. The My Namespace is not available in C#.
3. I doubt that the OP would have asked this question if it had been
C#, because C# makes the Program.cs file unmistakably obvious.

Michael,

VB has this penchant for hiding the most important parts of an
application from the developer. Application startup code is typically
added by the compiler behind the scenes in a Sub Main procedure. To
override this default behaviour, you need to create your own class/
module and add the Shared Sub Main (with the STAThread attribute, mind
you) procedure within that. Within this procedure, you can instantiate
and call the form you want to start with. Eg., (Application.Run
(myNewForm). Then, in the Project properties select your class/module
as the startup object.

On Jan 12, 10:14 am, Usman <[email protected]> wrote:
> By the way you didn't mentioned your language, i know the method in c#
> but not in vb.net
> that is as follows
> go to program.cs in your project Solution files, open that up and
> replace the code as
> Application.Run(new YourFormConstructor());

Reply via email to