473,385 Members | 1,356 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

PictureBox Scrolling

Hello,

Here's what I'd like to have in a form that I'm creating: A picture
box that contains an image that is significantly larger than the box.
I'd like for there to be scroll bars, but also to enable the user to
click and drag the image directly, with the scroll bars updating to
reflect which section of the image is shown on the screen.

I've created a panel and set it to AutoScroll, and put a PictureBox
into it. When the scroll bars are used, things work perfectly. When
I try to click and drag on the image (and update the Location of the
picture), the image moves as it should, but the scroll bars do not.
What happens is that the handles always stay in the same place, but
get wider or narrower as I change the .Location of the picture box.
Also, if I move the image to the upper left corner, the scroll bars
disappear completely, and if I move it to the bottom right, the scroll
bars have tiny scroll handles.

Any ideas of how to get this right?

Thanks,
Ben

Oct 6 '07 #1
1 4690
bw****@gmail.com wrote:
[...]
I've created a panel and set it to AutoScroll, and put a PictureBox
into it. When the scroll bars are used, things work perfectly. When
I try to click and drag on the image (and update the Location of the
picture), the image moves as it should, but the scroll bars do not.
[...]

Any ideas of how to get this right?
Instead of changing the Location property of the PictureBox when the
user drags, you should be changing the AutoScrollPosition property of
the Panel.

Pete
Oct 6 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Scott M | last post by:
Hi, I am writing a small game that is using a form 800 * 600. The form can be scrolled vertically up to a height of 1200 (basically the form can be scrolled down one screen vertically). The...
0
by: Paul Loveless | last post by:
Hi all. I have a user control that contains a picturebox within a panel with the panel set to autoscroll the picturebox. One thing that I have noticed with the default functionality is when you...
5
by: Sharon | last post by:
I’m writing a Windows application. In the form I have a Panel and inside the panel I have a PictureBox control. I’m loading the PictureBox control with BMP image that has the following...
0
by: 6tc1 | last post by:
Hi all, I've got a UserControl that contains a few PictureBox objects. If I click on outside of the Picture in the UserControl, the scrolling with the mouse button works - however, no amount of...
8
by: Yogiman | last post by:
Hi Can anybody tell me how would I attach scrollbars to a picturebox ? The example given in MSDN is pretty good.But I have a different problem. I have to do other stuff with the picturebox as well...
4
by: MJ | last post by:
as topic, anyone can provide some codes that enable a scroll bar to a picturebox when the picture expand?
3
by: Tom | last post by:
I have a picturebox on my VB.NET form. The picturebox size mode is set to stretched. I then load an image into that form and display it. As the user moves the mouse over the form, I want to get and...
4
by: midicad2001 | last post by:
I have been researching this issue and have come across a number of solutions apparently written for VB5 or 6 and don't work under .NET, yes folks that is progress! Someone in this ng suggested...
1
by: The Confessor | last post by:
I'm trying to develop a graphically-simple, gameplay-complex RPG, and I decided to create a graphical Proof of Concept just to confirm that graphics would be... well, simple. Predictably,...
0
by: swagatikasahoo | last post by:
how to display all lines if i will scroll the picturebox. hi, ok i m sending the code. ****************************************************** Private Sub PictureBox1_Paint(ByVal sender As Object,...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.