QCD_IS_GOOD
QCD_IS_GOOD

Reputation: 465

How do I detect when i release mouse button in VB?

How do I detect when I release the left mouse button in a VB program?

So currently using:

Private Sub Form1_MouseClick(ByVal sender As Object, ByVal e As
System.Windows.Forms.MouseEventArgs) Handles Me.MouseClick
   PictureBox1.Visible = True
End Sub

Means whenever I click my button the picturebox appears. So how do I get the picturebox to disappear when I release the mouse button?

Upvotes: 1

Views: 5388

Answers (1)

shf301
shf301

Reputation: 31394

The click event will only occur after the the user releases the mouse button. A click occurs when the left mouse button is pressed and released.

You want to use the MouseDown and MouseUp events.

Upvotes: 3

Related Questions