Jump to content

How to Force vertical scroll in GuiCtrlCreateListView


ToyleY
 Share

Recommended Posts

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
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.
Link to comment
Share on other sites

$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
Link to comment
Share on other sites

$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.
Link to comment
Share on other sites

$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

SciTE for AutoItDirections for Submitting Standard UDFs

 

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

 

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...