title: Visual Basic sender not coming back as control
body: <p>I have a windows application with 2 forms.</p>
  
  <p>frmMain has a button (btnEditAgent) on it that opens frmEditAgent:</p>
  
  <pre><code>Public Sub btnEditAgent_Click(sender As Object, e As EventArgs) Handles btnEditAgent.Click
      frmAgentEdit.ShowDialog()
  End Sub
  </code></pre>
  
  <p>Then on frmEditAgent load:</p>
  
  <pre><code>Private Sub frmAgentEdit_Load(ByVal sender As Object, e As EventArgs) Handles MyBase.Load
  
      MsgBox(sender.Name, vbOKOnly, "verify")
  
  End Sub
  </code></pre>
  
  <p>The sender comes back as "frmEditAgent" and not "btnEditAgent"</p>
  
  <p>I do not understand why this is happening.  In order for the rest of my code to work I need to know which button opened frmEditAgent.  Why is sender referring to the same form?</p>