Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Scroll Bars

Posted on 1997-04-19
5
Medium Priority
?
274 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
[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
5 Comments
 

Accepted Solution

by:
Matta earned 200 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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
Suggested Courses

618 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