Dear All,
How to add horizontal scrollbar to FileListbox
Dana
Printable View
Dear All,
How to add horizontal scrollbar to FileListbox
Dana
Use a listbox instead.
Combining these codes:vb Code:
Option Explicit Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" ( _ ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long Private Const LB_DIR = &H18D Private Const DDL_ARCHIVE = &H20 Private Const DDL_EXCLUSIVE = &H8000 Private Const LB_SETHORIZONTALEXTENT = &H194 Private Sub Command1_Click() List1.Clear SendMessage List1.hwnd, LB_DIR, DDL_EXCLUSIVE Or DDL_ARCHIVE, ByVal "C:\Windows\*.*" SetListboxScrollbar End Sub Private Sub SetListboxScrollbar() Dim i As Integer Dim new_len As Long Dim max_len As Long For i = 0 To List1.ListCount - 1 new_len = 10 + ScaleX(TextWidth(List1.List(i)), Me.ScaleMode, vbPixels) If max_len < new_len Then max_len = new_len Next i SendMessage List1.hwnd, LB_SETHORIZONTALEXTENT, max_len, 0 End Sub
http://www.vbforums.com/showpost.php...3&postcount=11
http://vb-helper.com/howto_listbox_h...scrollbar.html