title: How to raise event from user control to another form vb.net
body: <p>I am not familiar with user controls. I have user control with OK and Cancel buttons, I add this user control to an empty form during run time, I have another form which I called "Main Form", In the code I open the empty form and add the user control, after that <strong>I want to raise an event (on the OK button) from the user control (or from the empty form I don't know!) to the Main form!</strong> 
  I searched the net and found way to create an event and raise the event in the same form. I tried to do the same thing between different forms but I don't know how to do that.</p>
  
  <p>create event </p>
  
  <pre><code>Public Event OKEvent As EventHandler
  </code></pre>
  
  <p>raise event </p>
  
  <pre><code>Protected Overridable Sub OnbtnOKClick(e As EventArgs)
      AddHandler OKEvent , AddressOf btnOKClickHandler
      RaiseEvent OKEvent(Me, e)
  End Sub
  </code></pre>
  
  <p>event Sub</p>
  
  <pre><code>Sub btnOKClickHandler(sender As Object, e As EventArgs)
          'Event Handling
          'My event code 
      End Sub
  </code></pre>
  
  <p>handle my event on btnOK.click event</p>
  
  <pre><code>Private Sub btnOK_Click(sender As Object, e As EventArgs) Handles btnOK.Click
          OnbtnOKClick(e)
  End Sub
  </code></pre>
  
  <p>Okey, that all code works in the same form, maybe its messy but that what I found on the net, I want to make similar thing but on different forms, how can I organize my code? </p>