Solved

Picture Box scrollbars

Posted on 2004-08-03
3
628 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
[X]
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
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
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…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

615 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