Jump to content
Sign in to follow this  
ToyleY

How to Force vertical scroll in GuiCtrlCreateListView

Recommended Posts

ToyleY

Is it possible to force a vertical scroll bar in GuiCtrlCreateListView?

I have tried $WS_VSCROLL (general style) but the scroll bar does not show up (if list is too short)

The line below does not show a scroll bar?

GuiCtrlCreateListView("Date|time", 127, 69, 400, 228, $WS_VSCROLL)

And ideas please?

Edited by ToyleY

Share this post


Link to post
Share on other sites
martin

Is it possible to force a vertical scroll bar in GuiCtrlCreateListView?

I have tried $WS_VSCROLL (general style) but the scroll bar does not show up (if list is too short)

The line below does not show a scroll bar?

GuiCtrlCreateListView("Date|time", 127, 69, 400, 228, $WS_VSCROLL)

And ideas please?

Windows scroll bars don't appear unless there is something to scroll, otherwise you would have a bar which you couldn't move so what would be the point of showing it.


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites
ToyleY

Windows scroll bars don't appear unless there is something to scroll, otherwise you would have a bar which you couldn't move so what would be the point of showing it.

Thanks but .....

There is $LBS_DISABLENOSCROLL 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.

It's a right mess if I can't force a vertical scroll bar.

Share this post


Link to post
Share on other sites
martin

Thanks but .....

There is $LBS_DISABLENOSCROLL 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.

It's a right mess if I can't force a vertical scroll bar.

That's interesting, I didn't know about that.

LBS_DISABLENOSCROLL (Windows Version 3.1 or Later)

The LBS_DISABLENOSCROLL style causes the list box to disable any scroll bar that is not needed because the current contents fit the list box. Normally, when a list box scroll bar is not needed, it is hidden. The LBS_DISABLENOSCROLL style must be used in conjunction with the WS_VSCROLL or WS_HSCROLL style.

So it should do what you want. I tried it and didn't get the disabled scroll bar. Have you got an example where it shows?


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites
ToyleY

$LBS_DISABLENOSCROLL does not work with GuiCtrlCreateListView

I've given up with it. I'm now using $LVM_SETCOLUMNWIDTH, with a test of how many are in the list (so I can set the columns to ether the full extent or shorter, to accommodate a vertical scroll bar [when it appears] -- so I don't get an unwanted horizontal scroll bar and/or messed up grid lines).

It's a lot of work for a simple thing.

Ta anyways.

Edited by ToyleY

Share this post


Link to post
Share on other sites
martin

$LBS_DISABLENOSCROLL does not work with GuiCtrlCreateListView

I've given up with it. I'm now using $LVM_SETCOLUMNWIDTH, with a test of how many are in the list (so I can set the columns to ether the full extent or shorter, to accommodate a vertical scroll bar [when it appears] -- so I don't get an unwanted horizontal scroll bar and/or messed up grid lines).

It's a lot of work for a simple thing.

Ta anyways.

If you just want to redraw the listview to get rid of the messed up grid lines then you can do this

DllCall("user32.dll", "int", "InvalidateRect", "hwnd", GUICtrlGetHandle($ListView), "int", 0, "int", 1)

It might be simpler if it works for your script.


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites
GaryFrost

$LBS_DISABLENOSCROLL does not work with GuiCtrlCreateListView

I've given up with it. I'm now using $LVM_SETCOLUMNWIDTH, with a test of how many are in the list (so I can set the columns to ether the full extent or shorter, to accommodate a vertical scroll bar [when it appears] -- so I don't get an unwanted horizontal scroll bar and/or messed up grid lines).

It's a lot of work for a simple thing.

Ta anyways.

LBS_DISABLENOSCROLL => LB = ListBox not LV = ListView

Not interchangeable

  • Thanks 1

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.