title: How do I detect a mouse click anywhere on a form in vb.net?
body: <p>Ok so I know how to check if the user has clicked on a specific object, however I really don't care if where the user clicks, I just need to know if they've clicked (Whether on the actual form or on an object or whatever). My code is this:</p>
  
  <pre><code>Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
  
  Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
  
      If GetAsyncKeyState(1) Then
          Label1.Text = "Left"
      Else
          Label1.Text = "Right"
      End If
  End Sub
  </code></pre>
  
  <p>When I run the code, I get an error:</p>
  
  <p>PInvokeStackImbalance was detected</p>
  
  <p>"A call to PInvoke function 'Mouse click!Mouse_click.Form1::GetAsyncKeyState' has unbalanced the stack. This is likely because the managed PInvoke signature does not match the unmanaged target signature. Check that the calling convention and parameters of the PInvoke signature match the target unmanaged signature."</p>
  
  <p>I'm very new to vb.net so the documentation really doesn't help me.
  Any help would be awesome :)</p>