Solved

Picture Box scrollbars

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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that undeā€¦
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

734 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