Solved

Scrolling a picture box

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
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…

743 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now