Solved

Picture Box scrollbars

Posted on 2004-08-03
3
618 Views
Last Modified: 2008-02-26
Hello

I have a Windows form that I am displaying a bitmap within inside a picturebox, now this bitmap has some drawing I made , rectangles and text drawings, everything is ok.

but when this bitmap is large ( I mean too many drawing inside it) it does not fit inside the page so i need the user to scroll down to see more , I added a vscrollbar but what I do not know how to do is : how can I make it work , how can I make the image move down and up when the user clicks on the scrollbar

the image is contained inside a picturebox , the picturebox is made to fit the whole windows form which is an MDI Child.

any ideas ?
0
Comment
Question by:marounk
3 Comments
 
LVL 4

Accepted Solution

by:
NTAC earned 300 total points
ID: 11707885
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 11714676
You might also want to think about a scrollable Panel control.

Bob
0
 
LVL 22

Expert Comment

by:_TAD_
ID: 11716532

*NOT FOR POINTS*

I'd follow Bob's suggestion.

put a panel on your form and size it the way you want.

Then dynamically add a picturebox to that panel that contains your picture




<button click event>
         PictureBox p;
         panel2.AutoScroll = true;

         // new picturebox
         p = new PictureBox();

         // set picture
         p.Image = Image.FromFile(@"C:\temp\test.jpg");

         // set size and location of picturebox
         p.Location = new Point(10,10);
         p.Size = new Size(p.Image.Width,p.Image.Height);

         // add picturebox to scrolling panel
         panel2.Controls.Add(p);
         
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

Suggested Solutions

Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

757 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

20 Experts available now in Live!

Get 1:1 Help Now