Solved

Scroll Bars

Posted on 1997-04-19
5
270 Views
Last Modified: 2008-03-06
I want to be able to scroll objects in a frame contol, however a frame control does not have a scroll bar property like that of a text box or list box. Is it possible to link a vertical scroll bar to a frame control via code to produce a scrolling effect ? If so please provide a sample of code. If there is not a way by this method then what are some recommendations to attain this result ?
   Some things I've already experimented with are the updown control, slider control and the vertical scroll bar itself. Please keep in mind though I have experimented with these I'm a novice and very little experience with programming. I might have missed or overlooked something.    I'm using VB5 pro version.
Thank You
0
Comment
Question by:VBHelp
5 Comments
 

Accepted Solution

by:
Matta earned 100 total points
ID: 1425523
I don't think it's possible to do that.
You must find out an other way!!
0
 

Author Comment

by:VBHelp
ID: 1425524
Sorry for the "F" rating.  But your answer is unacceptable, I believe it is possible and you did not even make a single recommendation as an alternative.  I have asked this very same question to other sources on the web and gathered zip files and example forms from other programmers.
The least you could have done for a "C" rating would to have  recommended a company who makes OCX tools and controls, like sheridan for example.
If it were not possible than Windows 95 would never be, nor would all the versions of VB, all the versions of MS Word would be but a lost thought or idea.  Excel,  Publisher, Works and all the slew of other Microsoft products would be but a whim.
Therefore it is POSSIBLE !!!!!!!!!
0
 
LVL 7

Expert Comment

by:tward
ID: 1425525
I haven't tried this on a frame control but I have added a horizontal scroll bar to a Listbox.  The calls I used is as follows:

GLOBALS.BAS
--------------------------
Public GreatestLength%

Public Const NUL = 0&
Public Const WM_USER = &H400
Public Const LB_SETHORIZONTALEXTENT = (WM_USER + 21)

Public Declare Function SendMessage Lib "User" (ByVal hWnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, lParam As Any) As Long
Public Declare Function GetFocus Lib "User" () As Integer

-------------------
In My Form
-------------------
Dim ListHwnd%

' Get Focus of New Structure List Box '
NewFilesList.SetFocus

' Get the Window Handle '
ListHwnd = GetFocus()
   
' If the Current Text Width is Greater Than the Last Biggest one '
' then Change/Add Horizontal Scroll Bar to the New Structure    '
' ListBox via the SendMessage API Call                                      '
If TextWidth(CompleteFilename) > GreatestLength Then
 
' Save New Length '
GreatestLength% = TextWidth(CompleteFilename)
         
' Add/Change Size of Horizontal Scroll Bar '
Call SendMessage(ListHwnd%, LB_SETHORIZONTALEXTENT, GreatestLength%, NUL)
-----------

Granted this is for 16 Bit VB4 but you should be able to adjust it for 32 Bit without a problem.  Hope this helps you out!

0
 

Author Comment

by:VBHelp
ID: 1425526
tward should now be awarded for attempting to answer my question, however the main question has yet to be addressed. But he did make an effort. Therefore a "C" score.
Thanks tward I'll use your example as a model for my program.
0
 

Expert Comment

by:tm050597
ID: 1425527
Based on what I think it is you are wanting, I would suggest a tabstrip control.  That, to me, would be a better way of organizing your program.  Reply via email if you would like code.

tm
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
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…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

825 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