title: how to run a function/sub after loading the form window in VB?
body: <p>I have a function that gets User ID from USB badge reader, used to log in an application. 
  when I run the app, the log in window does not appear until I swipe the tag.
  I need to know if it`s possible to load the windows, then to start running the function that gets the data from the USB.</p>
  
  <p>Thanks :)</p>
  
  <pre><code>Private Sub SerialPort1_DataReceived()
      'Threading.Thread.SpinWait(1000)
      OpenPort()
      If SerialPort1.IsOpen() Then
  
          byteEnd = SerialPort1.NewLine.ToCharArray
          'read entire string until .Newline 
          readBuffer = SerialPort1.ReadLine()
          readBuffer = readBuffer.Remove(0, 1)
          readBuffer = readBuffer.Remove(8, 1)
          WWIDTextBox.AppendText(readBuffer)
  
      End If
  End Sub
  
  Private Sub Form1_Activated(ByVal sender As Object, _
  ByVal e As System.EventArgs) Handles MyBase.Activated
      SerialPort1_DataReceived()
  End Sub
  
  Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
      'SerialPort1_DataReceived()
  End Sub
  </code></pre>