Solved

Scroll Bars

Posted on 1997-04-19
5
271 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VBS file using code from 2nd file (txt or vbs) 4 47
Run code from text file in vb 1 87
Access 2013 combo box not working 3 58
vb6 connector to mongodb 2 141
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…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…

749 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