May 9, 2012 by Nitesh

How to Change Startup Form in VB .Net Windows Application

Today, I was working on a demo VB.Net windows application and going the Visual studio way, I added a new Windows Form Application in VB.Net. It created a default Form1.vb form with start up items. I added a new form MainForm.vb and then I wanted to change the application start up form to MainForm.vb from Form1.vb

In C#, we know we had a Program.cs file and was expecting something similar to this in VB.Net too, but could not find it out. So, how to do this..Here is the solution:

  • Click Show All Files in Solution Explorer
  • Open Application.myapp file
  • Look for element <MainForm>
  • Edit the value for this element
  • Save and Build the application
  • Run the application again and you’re done!
  • Sorry but I must say you have really re-invented the wheel here. All you have to do is right click the prj and select properties -> Choose start up form accordingly. Thanks

    • Charlie, I also knew the same but unfortunately inmy case VS did not allowed me to do so. Hence, I needed to reinvent the wheel…

Support us!

If you like this site please help and make click on any of these buttons!

Powered by WordPress Popup