Jump to content
Xtreme .Net Talk

Recommended Posts

  • Leaders
Posted

use the Form's MouseDown event , eg:

   Private Sub Form1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseDown
       If e.Button = MouseButtons.Left Then
           MessageBox.Show("you clicked the Left mouse button")
       End If
   End Sub

Posted

hu?

 

for some reason this won't work

 

    Private Sub Form1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseDown
       Dim rightClick As New rightclick()
       If e.Button = MouseButtons.Left Then
           rightclick.MdiParent = Me
           rightclick.Show()
       End If
   End Sub

  • Administrators
Posted

When you say it doesn't work - exactly what do you mean? does it fail to compile? Crash at runtime? Not work as expected? How is rightclick declared?

 

Also in Vb I would recomend agains using variable names that are the same as class names - it can lead to confusion as VB isn't case sensitive.

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...