title: Writing VB.NET Windows Forms Application using CodeDom
body: <p>How can you write a VB.NET Windows Forms Application via CodeDom?</p>
  
  <p>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.</p>
  
  <pre><code>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
  </code></pre>