2 Replies - 4152 Views - Last Post: 08 October 2010 - 01:22 PM Rate Topic: -----

#1 shain mcvay  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 19
  • Joined: 26-June 08

IN VB I want to select a picture box and make it move with a mouse cli

Posted 07 October 2010 - 06:56 PM

I'm making a game and I want to select a picturebox while the program is running. Then I want to make it move with I think the mouse click event. How do I go about doing this?
Is This A Good Question/Topic? 0
  • +

Replies To: IN VB I want to select a picture box and make it move with a mouse cli

#2 Sergio Tapia  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1253
  • View blog
  • Posts: 4,168
  • Joined: 27-January 10

Re: IN VB I want to select a picture box and make it move with a mouse cli

Posted 08 October 2010 - 04:53 AM

(Assuming you mean VB.Net)

Read about the Mouse_Down event. I'm sure the pictureBox control has a Mouse_Down event. Create it's event handler for it by clicking the lightning bolt on the Properties Pane (F4).

Inside of this event you'll want to modify the .Location property of the pictureBox so that it moves around relative to the mouse position.
Was This Post Helpful? 0
  • +
  • -

#3 shain mcvay  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 19
  • Joined: 26-June 08

Re: IN VB I want to select a picture box and make it move with a mouse cli

Posted 08 October 2010 - 01:22 PM

View PostSergio Tapia, on 08 October 2010 - 03:53 AM, said:

(Assuming you mean VB.Net)

Read about the Mouse_Down event. I'm sure the pictureBox control has a Mouse_Down event. Create it's event handler for it by clicking the lightning bolt on the Properties Pane (F4).

Inside of this event you'll want to modify the .Location property of the pictureBox so that it moves around relative to the mouse position.


Yes VB.Net. But I'm not sure if it's the mouse down event. I want the item selected to move torwards where I clicked. I don't want to
hold down the mouse, just click.

Also do you have any ideas how how to select a picture ox to make only the one I have selected move with the mouse click?

This post has been edited by shain mcvay: 08 October 2010 - 01:23 PM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1