Solved

Adding Scroll Bars

Posted on 2003-11-27
4
428 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 125 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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

831 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