title: Public Sub New() firing function in VB.net
body: <p>Hey all I am converting some C# code to VB.net and noticed that the C# code has a <strong>Public Sub New()</strong>. The C# code is this:</p>
  
  <pre><code>private readonly SController _controller; 
  
  public SView():this(new SController()) { }
  
  public SView(SController controller)
  {
      InitializeComponent();
      _controller = controller;
      controller.EnumerateDevices(deviceDropdown.Items);
      _thread = new Thread(ReadLoop) {IsBackground = true};
      _thread.Start();
  }
  </code></pre>
  
  <p>And converting the above to VB.net:</p>
  
  <pre><code>Private ReadOnly _controller As SController
  
  Public Sub New()
     Me.New(New SController())
  End Sub
  
  Public Sub New(controller As SController)
     InitializeComponent()
     _controller = controller
     controller.EnumerateDevices(deviceDropdown.Items)
     _thread = New Thread(AddressOf ReadLoop) With { _
        .IsBackground = True _
     }
  
     _thread.Start()
  End Sub
  </code></pre>
  
  <p>The problem I am running into is that since VB starts with:</p>
  
  <pre><code>Private Sub SView_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
  </code></pre>
  
  <p>How can I tell it to fire off the <strong>Public Sub New()</strong> function?</p>
  
  <p>I tried just putting:</p>
  
  <pre><code>Private Sub SView_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
      Me.New(New SController())
  End Sub
  </code></pre>
  
  <p>But it gives me the error of:</p>
  
  <pre><code>Constructor call is valid only as the first statement in an instance constructor.
  </code></pre>
  
  <p>Any help would be great to solve this issue!</p>
  
  <p><strong>update</strong></p>
  
  <pre><code>Private Sub SView_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
     Dim _sView As New SView
  End Sub
  </code></pre>
  
  <p>It never hits the Load when I put a break on line <strong>Dim _sView As New SView</strong></p>