Posted on 2001-07-27
Last Modified: 2010-05-02
Well I hava a problem... I must show a picture but when the piscture is bigger than teh object is doesn't shows comlpetly.... I want to add a scrollbar but I don't know how to implement it
can U explain me??? please
if you have code is better for me..
Question by:Iamme
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 22

Expert Comment

ID: 6327562
The best way I've found is to drop the picturebox into a frame along with the scrollbar(s), then have the scrollbars min set to 0, max set to frame.width - scrollbar.width, then add code to the Scroll event procedure to move the picture based on the negative of the value.

Expert Comment

ID: 6327730
Well you could also use the image control instead of the picture control. The image control has a property called stretch which will stretch the picture to the size of the image control reducing or increasing the size of the picture.

Accepted Solution

viklele earned 100 total points
ID: 6329245
A couple of options :

1. Use Imaging for Windows (Kodak / Wang imaging control). It will provide a lot (believe me .. a lot) of additinal functionality too. Downside ... you can't distribute Kodak/Wang imaging control ... though it is free).

2. Create a scrollable view port and put your picture control indei that. I wouldn't say that making scrollable viewport is difficult, but its not something that one does everyday.

3. Buy third party view port control (VSView is one I know .. there must be a few more out there).

There is an implementation of scrollable viewport available in MSDN site. I ma providing the URL here, I see no point in cut-pasting the code here.



search for Q186429 on, you will get a few more references and eloberations on microsoft's implementation.

- Vikram
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now


Expert Comment

ID: 6329273
you should refer MSDN , i has complete example for your scenario.

Basically it is PIP - PictureBox in PictureBox, and you have scroll bars - you can use intrinsic scrollbars or flat scrollbars.

The innner picturebox has property somewhat in effect which says - stretch to picture size.
which must be set to true.

Since it is there in MSDN, I will paste the code/link if you need it.


Expert Comment

ID: 6329280
I have made exactly what amit and others describe. If you can't find it in MSDN, let me know and I'll paste an example .frm file here.

Expert Comment

ID: 6333092

Here's a file over the net for you:


Description: Use a small map window to let the user view a larger picture (26K)

That's it!

glass cookie : )
LVL 49

Expert Comment

ID: 7161615
Hi Iamme,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept viklele@devx's comment(s) as an answer.

Iamme, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
DanRollins -- EE database cleanup volunteer

Expert Comment

ID: 7182464
Comment from expert accepted as answer

E-E Moderator

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

739 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