Scroll Bars on Images
Scroll Bars on Images
Scroll Bars on Images
Scroll Bars on Images
Scroll Bars on Images
Scroll Bars on Images Scroll Bars on Images Scroll Bars on Images Scroll Bars on Images Scroll Bars on Images Scroll Bars on Images Scroll Bars on Images Scroll Bars on Images
Scroll Bars on Images Scroll Bars on Images
Scroll Bars on Images
Go Back  Xtreme Visual Basic Talk > > > Scroll Bars on Images


Reply
 
Thread Tools Display Modes
  #1  
Old 11-27-2003, 12:31 AM
Lanc1988 Lanc1988 is offline
Newcomer
 
Join Date: Nov 2003
Posts: 7
Question Scroll Bars on Images


I have an image that is to big to fit on the program, so I want to use the horizontal and vertical scroll bars to navigate around the image.

I have visual basic.net 2003 and I used the toolbox to place the image and the two scroll bars on the image. Now i just need the code for the scroll bars to actually work with the image.

Thanks.
Reply With Quote
  #2  
Old 11-27-2003, 01:01 AM
wilbert's Avatar
wilbert wilbert is offline
Senior Contributor
 
Join Date: Dec 2002
Location: Netherlands
Posts: 867
Default

When clicking the scrollbar change the images top and left properties.

Wilbert
Reply With Quote
  #3  
Old 11-27-2003, 08:32 PM
Lanc1988 Lanc1988 is offline
Newcomer
 
Join Date: Nov 2003
Posts: 7
Default

there isn't top and left properties..

I have visual basic.net 2003, in case that matters
Reply With Quote
  #4  
Old 12-23-2003, 09:42 AM
Gulfraz Khan Gulfraz Khan is offline
Newcomer
 
Join Date: Dec 2003
Posts: 5
Default

Quote:
Originally Posted by Lanc1988
I have an image that is to big to fit on the program, so I want to use the horizontal and vertical scroll bars to navigate around the image.

I have visual basic.net 2003 and I used the toolbox to place the image and the two scroll bars on the image. Now i just need the code for the scroll bars to actually work with the image.

Thanks.




May be I can Help You !!!!!!!!!!!!!!

Place and assign following properties to controls on the form

Control Type: Panel
Control Name: pnl

' Place PictureBox Control on the above panel Control
Control Type: PictureBox
Control Name: PB
Size Mode: Stretched
' Place Horizontal Scroll Bar on the bottom of the panel (Width of the scroll bar should be equal to the width of the panel
Control Type: Horizontal Scroll
Control Name: HS
'Place Vertical Scroll Bar on the right of the Panel (Heitht of the Scroll bar should be equal to the height of the panel
Control Type: Vertical Scroll
Control Name: VS
'####### Should Look Like a Standard Control##############
'Begin
I am supposing the size of the image is greater than Panel Size.
Place the Following Code in the Form Load event (for instance)
hs.max = pnl.width - pb.width
vs.max = pnl.height - pb.height
'End

'Place the Following Code in the Scroll Event of the Horizontal Scroll Bar (HS in this example) and also in the Scroll Event of the Vertical Scroll Bar (VS in this example)
'begin code
Dim NewLocation as New Point
NewLocation.X = hs.value * -1
NewLocation.Y = vs.Value * -1
pb.Location = NewLocation
'end code
'####### I Hope this piece of Code will help you #############
'############# Comments and Suggestions: gulfraz2010@yahoo.com

Thank You,

Name: Gulfraz Khan
Gender: Male
City: Islamabad
Country: Pakistan
Age: 23
Experience in VB: Just a Beginner
Reply With Quote
  #5  
Old 12-28-2003, 11:59 PM
AndreRyan AndreRyan is offline
Contributor
 
Join Date: Jan 2002
Posts: 489
Default

If you want to do this as simply as possible:
Place a panel on the form, set it's AutoScroll property to True
Place a PictureBox inside the panel, set SizeMode to "AutoSize"
Set the picturebox to your picture, you'll be able to scroll around it.

Note that this is a rigid method, but is effective for many things, you could write a Paint Program using this method if you wanted.
__________________
If you're a beginner or have little experience don't launch into something beyond your abilities, for example don't start game programming by trying to make a 3D first person shooter if you have no idea how to use DirectX and/or OpenGL or how to keep track of objects in a 2D plane let alone a 3D one.
Reply With Quote
  #6  
Old 12-30-2003, 06:30 AM
Gulfraz Khan Gulfraz Khan is offline
Newcomer
 
Join Date: Dec 2003
Posts: 5
Default

Quote:
Originally Posted by AndreRyan
If you want to do this as simply as possible:
Place a panel on the form, set it's AutoScroll property to True
Place a PictureBox inside the panel, set SizeMode to "AutoSize"
Set the picturebox to your picture, you'll be able to scroll around it.

Note that this is a rigid method, but is effective for many things, you could write a Paint Program using this method if you wanted.




You May Be right!
But the panel control could not help me when i tried to scroll the image to a specific location, because, the panel control measures its scroll bar values in the form of displacement

I used this technique because it helped me to scroll the image at my desired location.

if you can help me in scrolling the image to a specific location,
please reply me.
Thank You,
Gulfraz Khan

gulfraz2010@yahoo.com
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
scroll bars wont anthonylmin General 7 06-23-2003 07:43 PM
Scroll Bars Cinnamon General 9 11-19-2002 06:24 AM
MSFlexGrid Scroll Bars tangentative General 3 03-12-2002 12:19 PM
scroll bars and images BIGBOB General 3 11-23-2001 06:47 PM
How to get Scroll Bars on MDI Child From? nkanakagiri General 0 10-18-2000 03:39 PM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Scroll Bars on Images
Scroll Bars on Images
Scroll Bars on Images Scroll Bars on Images
Scroll Bars on Images
Scroll Bars on Images
Scroll Bars on Images Scroll Bars on Images Scroll Bars on Images Scroll Bars on Images Scroll Bars on Images Scroll Bars on Images Scroll Bars on Images
Scroll Bars on Images
Scroll Bars on Images
 
Scroll Bars on Images
Scroll Bars on Images
 
-->