DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2009

    Unhappy student in need of help

    hello everyone . I'm taking my first class in visual basic (first time writing code) and have been doing ok. The lastest project has me stumped and I was hoping someone could give me some help. I'm to make a class called "robot" with a method for movig it. The robot is a simple label that moves on the form. I have 6 buttons, 4 to change direction of the movement (the label is set to appear as an arrow pointing in the direction chosen). The last two buttons either make it go 1 or 10 in the chosen direction. So what kind of method do I need to make the "robot" move?
    Thanks in advance

  2. #2
    Join Date
    Nov 2003
    Portland, OR
    Just set the label's .Left or .Top properties to the desired value. For example, to move it left 10 pixels:

    RobotLabel.Left -= 10
    Phil Weber

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

  3. #3
    Join Date
    Dec 2009
    Thanks for the reply. But I'm not sure that will work for me. I need for one of the for direction buttons to set the direction. Then when the user presses the 1 or 10 button, it move that many pixels in the earlier specified direction.

  4. #4
    Join Date
    Apr 2007
    Sterling Heights, Michigan
    So, put Phil Weber's example in the "Left" movement button...

Similar Threads

  1. String Array in C++
    By saruman in forum C++
    Replies: 13
    Last Post: 11-19-2007, 03:51 PM
  2. string array in c++
    By emeric in forum C++
    Replies: 11
    Last Post: 07-16-2007, 09:36 PM
  3. New to JLabel and JTextArea...
    By Fay_dL in forum Java
    Replies: 1
    Last Post: 07-16-2006, 08:25 PM
  4. StudentList Class
    By WillisTi in forum Java
    Replies: 2
    Last Post: 02-25-2005, 06:35 AM
  5. JAVA help
    By Munchkin in forum Java
    Replies: 3
    Last Post: 03-16-2001, 04:58 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center