|
|||||||
![]() |
|
|
Thread Tools | Search this Thread | Display Modes |
|
|
#1 |
|
Junior Member
Join Date: Nov 2008
Posts: 3
|
Problems getting horizontal scrollbars on a listbox working
I am trying to get a horizontal scrollbar to be displayed on the list box but with no success, below is what I am trying to do, I have also tried setting LB_SETHORIZONTALEXTENT as the msdn state that this needs to be set if you want to set WS_HSCROLL but it didn't help.
Has anybody else enabling the horizontal scrollbar? Function releaseNotesPage nsDialogs::Create /NOUNLOAD 1018 Pop $ReleaseNotesDialog ${If} $ReleaseNotesDialog == error Abort ${EndIf} ${NSD_CreateLabel} 0 0 100% 12u "Release notes." Pop $ReleaseNotesLabel ${NSD_CreateListBox} 0 13u 262u -13u "" Pop $ReleaseNotesText ${NSD_LB_AddString} $ReleaseNotesText "A really long string that should be longer than the listbox that contains this message, so I can enable the horizontal scrollbar, Please." SendMessage $ReleaseNotesText ${LB_SETHORIZONTALEXTENT} 20, 0 ${NSD_AddStyle} $ReleaseNotesText ${WS_HSCROLL} nsDialogs::Show FunctionEnd Thank-you Melflex. |
|
|
|
|
|
#2 |
|
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 2,779
|
LB_SETHORIZONTALEXTENT is used to specify the max scroll width, so it needs to be bigger than the listview. It also works better if WS_HSCROLL is there from the get go so you don't have to refresh the control
PHP Code:
IntOp $PostCount $PostCount + 1 |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Nov 2008
Posts: 3
|
That worked.
Thanks most appreciated. Melflex. |
|
|
|
|
|
#4 |
|
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 2,779
|
But of course, you might not know the end users font, or even how long the text is, so you can calculate it with this ugly code:
code: Edit: Added padding IntOp $PostCount $PostCount + 1 |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|