I'm adding a horizontal scrollbar to a listbox, and I need it scrolled all the way to the right end? Do you use SendMessage? :unsure:
Printable View
I'm adding a horizontal scrollbar to a listbox, and I need it scrolled all the way to the right end? Do you use SendMessage? :unsure:
Hi Madness.
When you say adding a scrollbar do you mean an external one like a hscroll control or not?
Cheers
I think you could just get the listbox to select the last entry in it's list.
Is this what you require?
VB Code:
Private Declare Function SendMessageByNum Lib "user32" _ Alias "SendMessageA" (ByVal hwnd As Long, ByVal _ wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long Const LB_SETHORIZONTALEXTENT = &H194 Private Sub Form_Load() SendMessageByNum list1.hwnd, LB_SETHORIZONTALEXTENT, 250, 0 End Sub
List1.Listindex = List1.List(list1.Listcount-1)
Thats what I'm doing at the moment, but I need to horizontal scrollbar scrolled all the way to the end.Quote:
Originally posted by laserman
Is this what you require?
VB Code:
Private Declare Function SendMessageByNum Lib "user32" _ Alias "SendMessageA" (ByVal hwnd As Long, ByVal _ wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long Const LB_SETHORIZONTALEXTENT = &H194 Private Sub Form_Load() SendMessageByNum list1.hwnd, LB_SETHORIZONTALEXTENT, 250, 0 End Sub
*bUmP*