Mouse Down Event - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Mouse Down Event

CitizenOlekCitizenOlek Posts: 53Member
Hello,

I have a PictureBox on a Form that increments a value when the Mouse Button is pressed, using the PictureBoxes MouseDown Event! Is there a way to detect if the Mouse Button is being held down and thereby to continuously increment that value until the user releases the Mouse Button?.

Comments

  • CitizenOlekCitizenOlek Posts: 53Member
    What I needed here was a Timer Event!
    I'd forgotten about that!

    Works great now.
  • patrickWpatrickW Posts: 1Member
    : What I needed here was a Timer Event!
    : I'd forgotten about that!
    :
    : Works great now.
    :
    Just what I need. Please let us see how you have done it.
    Regards
    Patrick

  • CitizenOlekCitizenOlek Posts: 53Member
    I pulled a Timer Control from the Toolbox.
    Gave it a name that associated it with my PicBox.
    ex: if the PicBox is pbMoreGold - then timer is tmrMoreGold.
    Using the Mouse Down event of the PicBox I Enable the associated timer.
    In the Timer event I increment my value - More Gold.
    (I'm writing a Game of Conquest)
    The value continues to increment every time the Timer fires.
    Until the Timer shuts off when we detect MouseUp in the PicBox

    I even got fancy with it so that the incrementing goes faster the longer you hold down the Button. Why kept the User waiting? Right?

    Hope that answers that!
Sign In or Register to comment.