student in need of help


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: student in need of help

  1. #1
    Join Date
    Dec 2009
    Posts
    4

    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
    Location
    Portland, OR
    Posts
    8,387
    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
    http://www.philweber.com

    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
    Posts
    4
    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
    Location
    Sterling Heights, Michigan
    Posts
    8,666
    So, put Phil Weber's example in the "Left" movement button...
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

Similar Threads

  1. String Array in C++
    By saruman in forum C++
    Replies: 13
    Last Post: 11-19-2007, 04:51 PM
  2. string array in c++
    By emeric in forum C++
    Replies: 11
    Last Post: 07-16-2007, 10:36 PM
  3. New to JLabel and JTextArea...
    By Fay_dL in forum Java
    Replies: 1
    Last Post: 07-16-2006, 09:25 PM
  4. StudentList Class
    By WillisTi in forum Java
    Replies: 2
    Last Post: 02-25-2005, 07:35 AM
  5. JAVA help
    By Munchkin in forum Java
    Replies: 3
    Last Post: 03-16-2001, 05: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
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

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