[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

how to scroll a picture box...

Posted on 2000-04-12
8
Medium Priority
?
243 Views
Last Modified: 2010-05-18
Hey all, I am developing an application for the Win32 enviroment in VB 6.  What I have is a form that has a picture box on it.  In this picture box is another picrute box with index of 0.  Other picture boxes may be loaded at run time, up to 24.  These will be tiled in the main picture box.  The main picture box has been sized to hold 6 (3*2)of the smaller boxes.  My question is how to make the main picture box able to scroll to show the rest of the smaller boxes.  I have tried the pager control at CCRP, but I couldn't get it to work.  Any suggestions on how I might accomplish this task?  I am willing to use a control other then a picture box if need be.

Thanks.
0
Comment
Question by:Ra
[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
  • 2
  • 2
  • +1
8 Comments
 
LVL 2

Accepted Solution

by:
Crin earned 400 total points
ID: 2709202
Hello
Add Another picturebox, name it "SuperMain" :)) place your picturebox into SuperMain picturebox, set your main picturebox appearence to 'flat' adjust color....
Now you can move your main picturebox (with small ones) inside SuperMain using

PictureBox1.move x,y,width,height

Enjoy :))

Sincerely yours,

Crin
0
 
LVL 9

Expert Comment

by:Ruchi
ID: 2709217
From the MSDN Library under the topic of "ScrollBar Controls Scenario: Creating a Scrollable Graphics Viewport" in the Visual Basic Documentation. Or, you can check this site: http://msdn.microsoft.com/library/devprods/vs6/vbasic/vbcon98/vbconscrollbarcontrolsscenariocreatingscrollablegraphicsviewport.htm 
0
 
LVL 28

Expert Comment

by:AzraSound
ID: 2709281
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:Ra
ID: 2709349
Thanks Crin.  Your answer worked prefectly.  I just set the left of the picture box to a negitive value rather then using that move function.  It works just the same.  Thanks again. :)
0
 
LVL 9

Expert Comment

by:Ruchi
ID: 2709362
Place two Pictureboxes, a vertical scrollbar and a horizontal scrollbar on the Form. Place Picture1 within Picture2 and Load the Picture you want to scroll into Picture1. This is just to give you an idea....

Option Explicit

Private Sub Form_Load()
    Picture2.ScaleMode = vbPixels
    Picture1.AutoSize = True
    Picture1.BorderStyle = vbBSNone
    Picture1.Move 0, 0
    VScroll1.Move Picture2.Left + Picture2.Width, Picture2.Top, VScroll1.Width, Picture2.Height
    HScroll1.Move Picture2.Left, Picture2.Top + Picture2.Height, Picture2.Width, HScroll1.Height
End Sub

Private Sub HScroll1_Change()
    Picture1.Left = -HScroll1
End Sub

Private Sub HScroll1_Scroll()
    HScroll1_Change
End Sub

Private Sub VScroll1_Change()
    Picture1.Top = -VScroll1
End Sub

Private Sub VScroll1_Scroll()
    VScroll1_Change
End Sub

Private Sub Picture1_Resize()
    If Picture2.ScaleHeight < Picture1.Height Then
        VScroll1.Visible = False
    Else
        VScroll1.Max = Picture1.Height - Picture2.ScaleHeight
'        VScroll1.LargeChange = VScroll1.Max / 10
        VScroll1.Value = 0
        VScroll1.Visible = True
    End If
    If Picture2.ScaleWidth < Picture1.Width Then
        HScroll1.Visible = False
    Else
        HScroll1.Max = Picture1.Width - Picture2.ScaleWidth
 '       HScroll1.LargeChange = HScroll1.Max / 10
        HScroll1.Value = 0
        HScroll1.Visible = True
    End If
End Sub
0
 
LVL 9

Expert Comment

by:Ruchi
ID: 2709366
Too late!!! No problem ;-)
0
 

Author Comment

by:Ra
ID: 2709380
hehe, sorry Ruchi.  Crin did get to it first and the page you linked to said pretty much the same thing.  Thanks anyways.
0
 
LVL 2

Expert Comment

by:Crin
ID: 2709385
Hope my comments was useful for you :)

Thank you for the points - it's interesting to me yet, because I'm second day here, on EE :))

Sincerely yours,

Crin
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

656 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