Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Manipulate the DBList Scrollbar during runtime??

Posted on 1998-04-25
3
Medium Priority
?
254 Views
Last Modified: 2008-02-01
i am using a DBLIST object and need a way to manipulate the scroll bar during run-time.  any suggestions
0
Comment
Question by:tdog
3 Comments
 
LVL 5

Expert Comment

by:bin_huwairib
ID: 1429321
What do you mean by "manipulate the scroll bar" ?
0
 
LVL 7

Accepted Solution

by:
tward earned 0 total points
ID: 1429322
The Following will allow you to set the TopIndex of the list box which will allow it to basically scroll up or down as needed to make sure the TopIndex is the One passed to it:

Public Const LB_ADDFILE = &H196
Public Const LB_ADDSTRING = &H180
Public Const LB_CTLCODE = 0&
Public Const LB_DELETESTRING = &H182
Public Const LB_DIR = &H18D
Public Const LB_ERR = (-1)
Public Const LB_ERRSPACE = (-2)
Public Const LB_FINDSTRING = &H18F
Public Const LB_FINDSTRINGEXACT = &H1A2
Public Const LB_GETANCHORINDEX = &H19D
Public Const LB_GETCARETINDEX = &H19F
Public Const LB_GETCOUNT = &H18B
Public Const LB_GETCURSEL = &H188
Public Const LB_GETHORIZONTALEXTENT = &H193
Public Const LB_GETITEMDATA = &H199
Public Const LB_GETITEMHEIGHT = &H1A1
Public Const LB_GETITEMRECT = &H198
Public Const LB_GETLOCALE = &H1A6
Public Const LB_GETSEL = &H187
Public Const LB_GETSELCOUNT = &H190
Public Const LB_GETSELITEMS = &H191
Public Const LB_GETTEXT = &H189
Public Const LB_GETTEXTLEN = &H18A
Public Const LB_GETTOPINDEX = &H18E
Public Const LB_INSERTSTRING = &H181
Public Const LB_MSGMAX = &H1A8
Public Const LB_OKAY = 0
Public Const LB_RESETCONTENT = &H184
Public Const LB_SELECTSTRING = &H18C
Public Const LB_SELITEMRANGE = &H19B
Public Const LB_SELITEMRANGEEX = &H183
Public Const LB_SETANCHORINDEX = &H19C
Public Const LB_SETCARETINDEX = &H19E
Public Const LB_SETCOLUMNWIDTH = &H195
Public Const LB_SETCOUNT = &H1A7
Public Const LB_SETCURSEL = &H186
Public Const LB_SETHORIZONTALEXTENT = &H194
Public Const LB_SETITEMDATA = &H19A
Public Const LB_SETITEMHEIGHT = &H1A0
Public Const LB_SETLOCALE = &H1A5
Public Const LB_SETSEL = &H185
Public Const LB_SETTABSTOPS = &H192
Public Const LB_SETTOPINDEX = &H197

Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByRef lParam As Long) As Long
Public Declare Function SendMessageLong Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Public Declare Function SendMessageAny Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Public Declare Function SendMessageArray Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long

Public Declare Function GetFocus& Lib "user32" ()

DBList1.SetFocus
Call SendMessageLong(GetFocus,LB_SETTOPINDEX, <Zero Based Index to Set>,0)
0
 

Author Comment

by:tdog
ID: 1429323
sorry tward for grading your answer so late! well, thanks for you answer.

tdog
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…
Suggested Courses

971 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