Posts: 32
Threads: 10
Joined: Apr 2006
Hi,
Can a horizontal scrollbar be added to a Single Column Listbox? (the content is wider than the Listbox)
Thanks,
Brad
Posts: 12,141
Threads: 143
Joined: Dec 2002
Send message LB_SETHORIZONTALEXTENT. Also add WS_HSCROLL style.
Function
Dialog85
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages
str controls = "3"
str lb3
lb3="a[]wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww[]c"
if(!ShowDialog("Dialog85" &Dialog85 &controls)) ret
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 223 135 "Dialog"
;1 Button 0x54030001 0x4 120 116 48 14 "OK"
;2 Button 0x54030000 0x4 170 116 48 14 "Cancel"
;3 ListBox 0x54330101 0x200 2 4 96 48 ""
;END DIALOG
;DIALOG EDITOR: "" 0x2030109 "" "" ""
ret
;messages
sel message
,case WM_INITDIALOG
,SendMessage id(3 hDlg) LB_SETHORIZONTALEXTENT 500 0
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1
Posts: 262
Threads: 63
Joined: Nov 2005
Can something like LB_SETHORIZONTALEXTENT be done for edit boxes?
SendMessage id(3 hDlg) LB_SETHORIZONTALEXTENT 500 0
Function
Scroll_Dialog
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages
str controls = "3"
str rea3
if(!ShowDialog("Scroll_Dialog" &Scroll_Dialog &controls)) ret
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 223 135 "Dialog"
;1 Button 0x54030001 0x4 120 116 48 14 "OK"
;2 Button 0x54030000 0x4 170 116 48 14 "Cancel"
;3 RichEdit20A 0x54033044 0x200 16 4 96 48 ""
;END DIALOG
;DIALOG EDITOR: "" 0x2030109 "" "" ""
ret
;messages
sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1
Posts: 12,141
Threads: 143
Joined: Dec 2002
No, just set WS_HSCROLL style and maybe change some other styles.
Posts: 32
Threads: 10
Joined: Apr 2006
Thank you very much! That works well.
Brad