Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > General > Using Keypress event to move an image around the form


Reply
 
Thread Tools Display Modes
  #1  
Old 11-02-2003, 06:21 PM
Sorcerer Cloud Sorcerer Cloud is offline
Freshman
 
Join Date: Nov 2003
Posts: 26
Default Using Keypress event to move an image around the form


Code:
Private Sub Form_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then Image1.Top = Image1.Top + 50 End If End Sub

I used this code to make the image move down 50 each time I push the enter key (13) but I only used code 13 because its the only one I know... is there a code table or something so I can use other keys?

Last edited by Sorcerer Cloud; 11-02-2003 at 06:28 PM.
Reply With Quote
  #2  
Old 11-02-2003, 06:27 PM
Illusionist's Avatar
Illusionist Illusionist is offline
Senior Contributor
 
Join Date: Oct 2003
Location: Chattanooga, TN USA
Posts: 1,069
Default

search the Object Browser(F2) for key constants
Reply With Quote
  #3  
Old 11-02-2003, 06:34 PM
Sorcerer Cloud Sorcerer Cloud is offline
Freshman
 
Join Date: Nov 2003
Posts: 26
Default

Quote:
Originally Posted by Illusionist
search the Object Browser(F2) for key constants



Hey thanx... I found the key codes and it works just how I wanted
Reply With Quote
  #4  
Old 11-02-2003, 06:40 PM
Illusionist's Avatar
Illusionist Illusionist is offline
Senior Contributor
 
Join Date: Oct 2003
Location: Chattanooga, TN USA
Posts: 1,069
Default

anytime
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
make image move across form cmeares General 8 09-13-2004 11:32 PM
Wants to Stop the Move with Keypress Event newneel General 4 10-08-2003 09:34 AM
PUblic array With images NeverMore5 Game Programming 3 02-07-2003 01:59 PM
form move event? asimsohailsaeed API 3 10-21-2002 02:26 AM
Disable Mouse Scroll in Sub Form nickg96 Database and Reporting 16 10-04-2002 11:12 AM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->