Results 1 to 4 of 4

Thread: {RESOLVED} [2005] keypress

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Dec 2005
    Posts
    28

    {RESOLVED} [2005] keypress

    i have just changed from using vb6 to vb2005 and i am trying to catch up with some of the vb6 ways of programming like. when you press left on the arrow keys the labbel moves to the left, and so on.

    this is how i would have done it in vb



    vb6 Code:
    1. Dim KeyAscii As Integer
    2.         Select Case KeyAscii
    3.             Case 73
    4.                 label1.Top = label1.Top + 1000
    5.             Case 77
    6.                 label1.Top = label1.Top - 120
    7.  
    8.             Case 74
    9.                 label1.Top = label1.Left + 120
    10.  
    11.             Case 76
    12.                 label1.Top = label1.Left - 120
    13.  
    14.         End Select
    15.     End Sub

    how would i do the same in vb2005,

    ps. i have searched the forums and carnt see much their to help me most of the results was how tot do it in vb6.

    regards, pip

    thank you in advance.
    Last edited by pipwilky; Jul 28th, 2007 at 01:31 PM. Reason: {RESOLVED}

    Currnet Projects Working on
    Games
    CrossWord (finsihed)
    Programms
    Ip IM

    an more i will up date later


    Please Mark all resloved posts with [RESLOVED] and a green tick.

  2. #2
    Hyperactive Member
    Join Date
    Aug 2005
    Location
    Lancashire UK
    Posts
    375

    Re: [2005] keypress

    If my post helps , please feel free to rate it

  3. #3
    PowerPoster sparrow1's Avatar
    Join Date
    May 2005
    Location
    Globetrotter
    Posts
    2,820

    Re: [2005] keypress

    Quote Originally Posted by pipwilky
    i have just changed from using vb6 to vb2005 and i am trying to catch up with some of the vb6 ways of programming like. when you press left on the arrow keys the labbel moves to the left, and so on.

    this is how i would have done it in vb



    vb6 Code:
    1. Dim KeyAscii As Integer
    2.         Select Case KeyAscii
    3.             Case 73
    4.                 label1.Top = label1.Top + 1000
    5.             Case 77
    6.                 label1.Top = label1.Top - 120
    7.  
    8.             Case 74
    9.                 label1.Top = label1.Left + 120
    10.  
    11.             Case 76
    12.                 label1.Top = label1.Left - 120
    13.  
    14.         End Select
    15.     End Sub

    how would i do the same in vb2005,

    ps. i have searched the forums and carnt see much their to help me most of the results was how tot do it in vb6.

    regards, pip

    thank you in advance.
    Hi,

    To change the position of a label you can do it like this;

    Code:
    Label1.Location = New Point(40, 20)  ' (40,20)= example
    Hope it helps,

    sparrow1
    Wkr,
    sparrow1

    If I helped you, don't forget to Rate my post. Thank you

    I'm using Visual Studio.Net 2003 and
    2005
    How to learn VB.Net Create setup with VB 2005 Drawing for beginners VB.Net Tutorials GDI+ Tutorials
    Video's for beginners

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Dec 2005
    Posts
    28

    Re: [2005] keypress

    ye thanks both of you very help full...




    Currnet Projects Working on
    Games
    CrossWord (finsihed)
    Programms
    Ip IM

    an more i will up date later


    Please Mark all resloved posts with [RESLOVED] and a green tick.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width