Jump to content



Photo

Scrollbar in a list box


  • Please log in to reply
9 replies to this topic

#1 SlimShady

SlimShady

    AutoIt lover

  • Active Members
  • PipPipPipPipPipPip
  • 2,383 posts

Posted 05 June 2004 - 09:45 AM

I have a listbox:
- I want to see a scrollbar when content doesn't fit in the current size
- AND the list items should not be sorted alphabetically.
I can't make it work.
I tried this:
$style2 = BitOr(0x00800000, 0x10000000) $ItemList1 = GUISetControl("list", "ItemList", 160, 40, 120, 225, $style2)


From the help file:

List box styles                        Value
LBS_DISABLENOSCROLL      0x1000
LBS_USETABSTOPS                0x0080


Edited by SlimShady, 05 June 2004 - 02:30 PM.






#2 Valik

Valik

    Former developer.

  • Active Members
  • PipPipPipPipPipPip
  • 18,879 posts

Posted 05 June 2004 - 01:51 PM

And what are those 2 styles? You'll get a lot more help a lot faster when you use the style names, not their number equivalents.

#3 SlimShady

SlimShady

    AutoIt lover

  • Active Members
  • PipPipPipPipPipPip
  • 2,383 posts

Posted 05 June 2004 - 02:31 PM

And what are those 2 styles?  You'll get a lot more help a lot faster when you use the style names, not their number equivalents.

I don't care much. I'm not in a hurry.
Anyways, I was tired and quickly made this topic.
I updated the first post.

#4 Valik

Valik

    Former developer.

  • Active Members
  • PipPipPipPipPipPip
  • 18,879 posts

Posted 05 June 2004 - 02:37 PM

You need WS_VSCROLL as well.

#5 SlimShady

SlimShady

    AutoIt lover

  • Active Members
  • PipPipPipPipPipPip
  • 2,383 posts

Posted 05 June 2004 - 02:48 PM

I mean a scrollbar in a listbox. Or is it not possible?

#6 Jos

Jos

    oh joy ...

  • Developers
  • 21,049 posts

Posted 05 June 2004 - 02:52 PM

LBS_DISABLENOSCROLL currently disables the scrollbar but the helpfile description says it should always display the vertical scroll bar...

Visit the SciTE4AutoIt3 Download page for the latest versions                                                                 Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)


#7 Valik

Valik

    Former developer.

  • Active Members
  • PipPipPipPipPipPip
  • 18,879 posts

Posted 05 June 2004 - 03:11 PM

SlimShady, Did you actually try adding that style in?

JdeB, LBS_DISABLENOSCROLL shows a scrollbar at all times. If there is not enough stuff in the list, then it is disabled, otherwise (And provided WS_VSCROLL is set), then the scrollbar will be enabled.

#8 Valik

Valik

    Former developer.

  • Active Members
  • PipPipPipPipPipPip
  • 18,879 posts

Posted 05 June 2004 - 03:15 PM

Should use the symbolic name... those styles aren't correct... There is a 4 bit difference between 0x00800000 and 0x0080:

0x00800000 = 8388608
0x0080 = 128 <--- The correct one.

#include <GuiConstants.au3> GuiCreate("Blah", 300, 300) $style2 = BitOr($LBS_DISABLENOSCROLL, $LBS_USETABSTOPS) $style2 = BitOr($style2, $WS_VSCROLL) $ItemList1 = GUISetControl("list", "ItemList", 160, 40, 120, 75, $style2) GuiSetControlData($ItemList1, "Blah|cool|abcde|exdfs|sfksjdlf|sldfkslfj|flskdfgjsdl|slkdhj") GUIWaitClose()

Edited by Valik, 05 June 2004 - 03:17 PM.


#9 Jos

Jos

    oh joy ...

  • Developers
  • 21,049 posts

Posted 05 June 2004 - 03:41 PM

understand what you are saying but my point was that if you use this script:
#include <GuiConstants.au3> GuiCreate("Blah", 300, 300) $ItemList1 = GUISetControl("list", "ItemList", 160, 40, 120, 75) GuiSetControlDataGUIWaitClose()
it will show the vscrollbar only when the records don't fit the listbox and then when you look at the explanation in the helpfile:

LBS_DISABLENOSCROLL  0x1000 Shows a disabled vertical scroll bar for the list box when the box does not contain enough items to scroll. If you do not specify this style, the scroll bar is hidden when the list box does not contain enough items.

You would expect that when you add LBS_DISABLENOSCROLL, it would always show the vScrolllBar.....

Visit the SciTE4AutoIt3 Download page for the latest versions                                                                 Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)


#10 SlimShady

SlimShady

    AutoIt lover

  • Active Members
  • PipPipPipPipPipPip
  • 2,383 posts

Posted 05 June 2004 - 05:16 PM

What I tested:
action: Give the listbox no style.
result: listbox has a vertical scrollbar.

action: Give listbox the LBS_USETABSTOPS style, so sorting alphabetically is disabled.
result: no vertical scrollbar, LBS_USETABSTOPS works fine.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users