Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Scrolling a picture box

Posted on 2000-02-16
3
Medium Priority
?
282 Views
Last Modified: 2008-03-03
Hello experts!

I'm using a VScrollBar and a HScrolBar to scroll a picture box, but I also want to scroll vertcally the picture box by using the keyboard keys arrow up and arrow down, and horizontally by using the keyboard keys arrow left and arrow right.

How could I do it?

Thanks in advance.
0
Comment
Question by:raulopez
3 Comments
 

Accepted Solution

by:
arfnarfsi earned 50 total points
ID: 2529109
Set the form's KeyPreview property to "True".  For the form's KeyPreview event, perform a Case Select for KeyAscii to equal vbKeyUp, vbKeyDown, vbKeyLeft and vbKeyRight.  For each of these, call/duplicate the subroutine for the scroll bars.
0
 
LVL 7

Expert Comment

by:Vbmaster
ID: 2529548
.. or increase/decrease the .Value property (instead of duplicating the subroutines).
0
 

Author Comment

by:raulopez
ID: 2532949
To: arfnarfsi

Sorry, but VB5 don't have form's KeyPreview event.

I've make the job in form's KeyCode event and works ok.

Thanks a lot for your answer.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

886 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question