Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Horizontal Scrollbar for Listbox?
#1
Hi,

Can a horizontal scrollbar be added to a Single Column Listbox? (the content is wider than the Listbox)

Thanks,

Brad
#2
Send message LB_SETHORIZONTALEXTENT. Also add WS_HSCROLL style.

Function Dialog85
Code:
Copy      Help
\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
#3
Can something like LB_SETHORIZONTALEXTENT be done for edit boxes?

SendMessage id(3 hDlg) LB_SETHORIZONTALEXTENT 500 0

Function Scroll_Dialog
Code:
Copy      Help
\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
#4
No, just set WS_HSCROLL style and maybe change some other styles.
#5
Thank you very much! That works well.

Brad


Forum Jump:


Users browsing this thread: 1 Guest(s)