Solved

Scroll Bars

Posted on 1997-04-19
5
267 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
Comment Utility
I don't think it's possible to do that.
You must find out an other way!!
0
 

Author Comment

by:VBHelp
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

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…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

728 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now