title: raising .net events from another class?
body: <p>can I call shared events contained in one class from another class?</p>
  
  <p>for example: </p>
  
  <p>logonclass.vb : handles login logic and authenticates against database</p>
  
  <p>logonmanager.vb: hold current user reference and some logon and timeout events</p>
  
  <p>Logon.vb: A form with a submit button.</p>
  
  <p>I would like to do something like this but I can't get the compiler to agree with it</p>
  
  <pre><code>If VerifyEntries() Then
          Try
              privLvl = LoginClass.AttemptLogin(txtUserName.Text, txtPassword.Text)
          Catch
          End Try
          If privLvl &gt; 0 Then
              'RaiseEvent LoginClass.UserLoggedIn()
              'RaiseEvent LoginManager.UIdisplaychange(privLvl)
              Me.Close()
          End If
  
      End If
  </code></pre>
  
  <p>If this isn't the proper way to wire things together let me know so I can learn to structure differently. In my planning it seemed like I was raising a lot of extra duplicate events from my logonclass to my loginmanager class. Then the loginmanager had to raise it again for the main form to see the change event. It got me thinking that if I publicly shared the events and could raise them from wherever then it would cut down on the amount of events I needed in code and the amount of them flying around at runtime.</p>