Solved

Picture Box scrollbars

Posted on 2004-08-03
3
625 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

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

Suggested Solutions

Title # Comments Views Activity
IEnumerable<T> to a List<T> 8 51
ASP.NET MVC -Update model when click on <li> element 29 64
Convert Silverlight ERP To Angularjs,HTML5 3 56
WPF Select Items 3 24
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…
This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
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…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

685 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