2 Replies - 892 Views - Last Post: 28 April 2012 - 11:48 AM Rate Topic: -----

#1 qobacha  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 27-April 12

Moving object with keyboard

Posted 27 April 2012 - 11:36 PM

Hi Every one

I have drawn a square on the screen/form using GDI. Now I want to move this object around using keyboard inputs. I just want it to move along the x-axis using left and right arrow keys. I can assign the keys but the problem is making that object move. Please help me on this
Is This A Good Question/Topic? 0
  • +

Replies To: Moving object with keyboard

#2 anonymous26  Icon User is offline

  • D.I.C Lover

Reputation: 2
  • View blog
  • Posts: 3,638
  • Joined: 26-November 10

Re: Moving object with keyboard

Posted 28 April 2012 - 11:33 AM

What research have you done to solve this problem?
Was This Post Helpful? 0
  • +
  • -

#3 qobacha  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 27-April 12

Re: Moving object with keyboard

Posted 28 April 2012 - 11:48 AM

I used the keydown event and assigned it to the keys. Then changed the value of X position to +/- depending on the direction the object was moving.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1