Solved

Scrolling a picture box

Posted on 2000-02-16
3
277 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

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

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

Suggested Solutions

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

828 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