How can you write a VB.NET Windows Forms Application via CodeDom?
I have tried everything, the closest i got to it is the code below, which first of all shows command prompt window which is not good, and then shows the form for like a second and everything disappears.
Is there another proper way to do it? An example is greatly appreciated.
Public Module MyApp
Public Sub main()
Dim NewForm As New System.Windows.Forms.Form
NewForm.Name = "Form1"
NewForm.Text = "Form1"
NewForm.Width = 300
NewForm.Height = 300
NewForm.FormBorderStyle = Windows.Forms.FormBorderStyle.FixedSingle
NewForm.ControlBox = True
NewForm.MaximizeBox = False
NewForm.MinimizeBox = True
NewForm.Show()
End Sub
End Module
After alot of research online, i have came to the following conclusion which seems to be working just fine.
Thanks to everybody for any input on this subject.
First of all open a new project add the following code to a button.
This code compiles the code that you write in the text file that you will create in the next step.
And then in the projects resources add a text file and add the following code to it.
This code is your application that you want to compile to a standalone EXE. And you can change it to the way you want.
If you have done everything above, after you click compile it should create a standalone EXE in the projects \bin\Debug under the name OutputApp.
Again thanks to everybody.
Hope the code above is useful to anyone who is trying to do the same thing.