[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Vertical scroll bar on VB6 form

Posted on 2007-10-09
9
Medium Priority
?
7,798 Views
Last Modified: 2013-12-20
In a VB6 app, I'd like to display a form which contains text and .jpg images.  Easy so far.  What's driving me nuts is adding a vertical scroll bar such that a user can scroll up and down a fully displayed screen and see any of the text and images he/she wishes.  Can someone explain (with code) exactly how?
0
Comment
Question by:wjshore
9 Comments
 
LVL 54

Expert Comment

by:Ryan Chong
ID: 20045969
The technique to make your form scrollable is actually put a picturebox in your form, put all other controls on to it, and then when we click the scrollbars, it actually scroll the picturebox, not the form itself.

Here are some samples on web:

http://www.freevbcode.com/ShowCode.Asp?ID=432
http://www.freevbcode.com/ShowCode.Asp?ID=1554
http://www.freevbcode.com/ShowCode.Asp?ID=3254

You can found out other similar samples from that website too.

Hope this helps
0
 
LVL 17

Expert Comment

by:Shanmuga Sundaram
ID: 20047287
0
 

Author Comment

by:wjshore
ID: 20049875
Thanks for the suggestions.  Apparently VB6 doesn't expose the standard Windows auto-scroll behavior (If a window is too small to display its content a scroll bar appears.)  I'm not experienced enough to get into API calls.   What I need is the ACTUAL CODE ( not general example) to program a vertical scroll bar placed in a PictureBox (or other appropriate container) to scroll up and down by means of the top and bottom scroll buttons.  Can someone please help?
0
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!

 
LVL 54

Expert Comment

by:Ryan Chong
ID: 20050005
>>What I need is the ACTUAL CODE ( not general example) to program a vertical scroll bar placed in a PictureBox

Actually that uses a VScrollBar and a HScrollBar control, with a PictureBox to do your scrollable form effect.

I think the examples above do provide you enough scripts to do that.

Let us know if you need more advice here.
0
 

Author Comment

by:wjshore
ID: 20071929
PLEASE, PLEASE, PLEASE!   The question is still open because none of the suggested examples provide what's needed.  I need very specific info on how to program a vertical scroll bar to function with it Top and Bottom buttons.
0
 
LVL 54

Expert Comment

by:Ryan Chong
ID: 20072704
I'm not very sure what's your problem now, the examples above should be helpful, perhaps you can post your codes or upload your project here?

http://www.ee-stuff.com/
0
 

Author Comment

by:wjshore
ID: 20073005
How do I close this question?
0
 
LVL 4

Accepted Solution

by:
amir22651 earned 2000 total points
ID: 21442334
hello
first: place a picturebox in ur form(pic1)
second: place another picturebox on your form and attach to it all of ur control for instance comboboxes and put it in the first picturebox(pic2)
third : ur second picturebox should be enough big to contain all of ur controls
forth:place vertical scroll bar beside ur first picturbox
fifth:use the code below :

VScroll1.Move form1.Width - VScroll1.Width, pic1.Top, VScroll1.Width, pic1.Height
pic1.Move 0, 0, Me.ScaleWidth - VScroll1.Width, Me.ScaleHeight
If pic2.Height <= pic1.Height Then
VScroll1.Visible = False
Else
VScroll1.Visible = True
VScroll1.Max = pic2.Height - pic1.Height
VScroll1.LargeChange = 2500
VScroll1.SmallChange = 250
End If
End Sub

Private Sub VScroll1_Change()
pic2.Top = -VScroll1.Value
End Sub

writing hole of the code here is boring but,
hope this will gives u  better idea
0
 

Author Closing Comment

by:wjshore
ID: 31408096
Thanks for your attention.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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 process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

834 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