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

x
?
Solved

Adding Scroll Bars

Posted on 2003-11-27
4
Medium Priority
?
433 Views
Last Modified: 2010-04-16
I have a C# program where I create and display a bitmap on a form. Sometimes the bitmap is too wide to fit on the form. How can I add scroll bars to access the whole bitmap?
0
Comment
Question by:jc31415
  • 3
4 Comments
 
LVL 20

Expert Comment

by:TheAvenger
ID: 9836203
There are scroll bar controls in the Toolbox. Then you can handle the movement of the scroll bars and make tne needed changes to the picture.

Or put the bitmap control in a panel with scroll bars. Then resize the bitmap control to be as big as the picture itself. Then the panel will automatically show the scroll bars.
0
 

Author Comment

by:jc31415
ID: 9837572
When I selected scroll bars from the Toolbox they seemed to only apply to a panel. How can they be made to apply to the form? How can I put the bitmap in a panel?
0
 
LVL 20

Expert Comment

by:TheAvenger
ID: 9837600
What control do you currently use to put the bitmap in? PictureBox?
0
 
LVL 20

Accepted Solution

by:
TheAvenger earned 500 total points
ID: 9837615
If yes, put a panel on the form, assign scroll bars to it, then put the picture box inside the panel. Then tell the picture box to resize itself based on the image (property SizeMode set to AutoSize). This should do the whole work
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

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

In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…

876 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