Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Moving ListBox scrollbar from code

Status
Not open for further replies.

IgiLama

Programmer
Feb 21, 2006
2
SK
Hi,

I want to implement functionality to ListBox that if something is draged into it and cursor is positioned near bottom/top, scrollbar will slowly scroll down/up so user can reach not currently visible components.

I haven't find any useful property or method of TListBox that can be used to change scrollbar position from code.

Anyone can help with this?
 
This is from C++ Builder Commonly Asked Questions #36. (
Code:
// scroll a list box vertically down by one line
SNDMSG(ListBox1->Handle, WM_VSCROLL, SB_LINEDOWN, 0); 
 

// Other scroll parameters that can be sent...
// SB_TOP          Scrolls to the upper left
// SB_BOTTOM       Scrolls to the lower right
// SB_ENDSCROLL    Ends scrolling
// SB_LINEDOWN     Scrolls one line down
// SB_LINEUP       Scrolls one line up 
// SB_PAGEDOWN     Scrolls one page down
// SB_PAGEUP       Scrolls one page up

James P. Cottingham
-----------------------------------------
I'm number 1,229!
I'm number 1,229!
 
Thanks a lot, this is exactly what I need.
Looks like good resource ...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top