Windows Forms and Controls

Compiling the project

I’m now going to compile this on the command line. Paste the complete code into notepad and save it in it’s own directory. Now create a .bat file in the same directory and paste this into it:-

%windir%\Microsoft.NET\Framework\v1.0.3705\vbc.exe
/target:winexe /out:frmMain.exe /r:system.dll,system.drawing.dll,system.windows.forms.dll frmMain.vb


O.k. what the hell is this I hear you cry. Well this is a call to the VB.Net compiler vbc.exe using the generic %windir% to get your windows directory. Note you should check you are using v1.0.3705 of the framework otherwise the directory may be different and may not even work. I then specify with switches what I want. I want it to create a Windows Executable - /target:winexe, to create an exe called frmMain.exe - /out:frmMain.exe, I’m referencing various .dlls using the /r which can also be /reference and finally the file to compile is frmMain.vb.

Run this batch file and it should create frmMain.exe in the same directory. Run that exe and it should be exactly the same as what you created in VS.Net. VS.Net Is referred to as an IDE. That is it is an aid to creating .Net applications and as such is not an absolute requirement to do so.

O.k. I hope this helped, I hope it didn’t confuse and if it didn’t work then let me know and I’ll see if I can sort out where you’re going wrong. I’ve been a long time VB/Asp Developer and I have to admit I’m very excited about .Net. It’ll take some time to get a grasp of everything you can do with it but I think it’ll be well worth it.
Happy Programming.

You might also like...

Comments

About the author

Brian O'Connell Ireland

Microsoft Certified Applications Developer with 10 years experience developing web based applications using asp, asp.net for a Local Authority in Dublin. Clings to a firm belief that a web appli...

Interested in writing for us? Find out more.

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“There are only 3 numbers of interest to a computer scientist: 1, 0 and infinity”