Sign in to follow this  
Followers 0
Valuater

ListView - scroll-bars

15 posts in this topic

is it possible to "remove" the vertical and horizontal scroll bars in a ListView

i couldn't find it in the styles, extended styles, or the GuiListView.au3 commands

thx

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites



thru sub-classing maybe, from what I've seen it's not pretty.

Might ask Holger.

I take your word for it!... you know ListViews alot better than most

Maybe Holger has an extra bag of magic tricks..

But if its gonna be ugly... i will have to find another direction

thanks Gary

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

Two years old, but hoping someone has come up with a way for this since.?.?.?

Share this post


Link to post
Share on other sites

Scroll arrows are nasty. They are everywhere when we dont need them.

Share this post


Link to post
Share on other sites

I would love to see you be able to remove scroll bars, been searching and trying for weeks.

Share this post


Link to post
Share on other sites

I would love to see you be able to remove scroll bars, been searching and trying for weeks.

_GUIScrollBars_ShowScrollBar($hListView, $SB_BOTH, False)
See help file for example code.

Share this post


Link to post
Share on other sites

This works pretty well for GUIs but have no effect on ListViews...!?

_GUIScrollBars_ShowScrollBar($hListView, $SB_BOTH, False)
See help file for example code.

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

Seems like the great minds have already been at this one so I will provide my hack. It clips a guictrl. There was a repaint problem which I have never been able to solve. So if you minimize and restore you would have to remake the control.

<Edit> hmmm. no repaint problem for this solution as far as I can tell.

#include <GuiConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GuiListView.au3>

$iLastPos = IniRead("Test.ini", "Scroll", "VPos", 0)

$GUI = GUICreate("Test Script", 600, 200)

$ListView = GUICtrlCreateListView("Col          ", 20, 20, 260, 160)
$hListView = GUICtrlGetHandle($ListView)

$ListView2 = GUICtrlCreateListView("Col          ", 280, 20, 260, 160)
_ControlToRoundedRectangle($ListView2,0,0,240, 160,0)
$hListView2 = GUICtrlGetHandle($ListView2)

For $i = 1 To 80
    GUICtrlCreateListViewItem("Item " & $i, $ListView)
    GUICtrlCreateListViewItem("Next " & $i, $ListView2)
Next

GUISetState(@SW_SHOW, $GUI)

While 1
    Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
    if _GUICtrlListView_GetTopIndex($hListView)<_GUICtrlListView_GetTopIndex($hListView2) then 
            _GUICtrlListView_Scroll($hListView2, 0, -12)
    elseif _GUICtrlListView_GetTopIndex($hListView)>_GUICtrlListView_GetTopIndex($hListView2) then 
            _GUICtrlListView_Scroll($hListView2, 0, +12)
    EndIf
    
WEnd

Func _ControlToRoundedRectangle($aControl,$X1,$Y1,$X2,$Y2,$X3)
    Local $l
    Local $handle = GUICtrlGetHandle($aControl)
    $l = DllCall("gdi32.dll","int","CreateRoundRectRgn","int",$X1,"int",$Y1,"int",$X2,"int",$Y2,"int",$X3,"int",$X3)
    DllCall("user32.dll","int","SetWindowRgn","hwnd",$handle,"int",$l[0],"int",True)
EndFunc
Edited by picea892

Share this post


Link to post
Share on other sites

This works pretty well for GUIs but have no effect on ListViews...!?

Yes it does. Think about it, controls are windows, so why shouldn't it?

#include <ScrollBarConstants.au3>
#Include <GuiScrollBars.au3>
#include <ListViewConstants.au3>

GUICreate(@ScriptName, 640, 480, -1, -1)
$listview = GUICtrlCreateListView("col1  |col2|col3|col4|col5  ", 10, 10, 200, 150, $LVS_NOCOLUMNHEADER);,$LVS_SORTDESCENDING)
$item1 = GUICtrlCreateListViewItem("item2|col22|col23|col24|col25", $listview)
$item2 = GUICtrlCreateListViewItem("item1|col12|col13|col14|col15", $listview)
$item3 = GUICtrlCreateListViewItem("item3|col32|col33|col34|col35", $listview)

GUISetState()

$hListView = GUICtrlGetHandle($listview)
_GUIScrollBars_ShowScrollBar($hListView, $SB_BOTH, False) ;remove comment and scrollbars disappear

Do
    Sleep(10)
Until GUIGetMsg() = -3

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

Cool! 100% ! Greate! :-)

Edited by supersonic

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

Hmm... Temporary the scroll bars disappear... But when selecting Items via mouse,

the scroll bars reappear... Strange.

You can put _GUIScrollBars_ShowScrollBar() somewhere between the Do/Until-Loop,

but this isn't a real solution...

For the moment, the "hack" from picea892 (see above) works pretty well as long

as sticking two ListViews together...

Edited by supersonic

Share this post


Link to post
Share on other sites

Hmm... Temporary the scroll bars disappear... But when selecting Items via mouse,

the scroll bars reappear... Strange.

You can put _GUIScrollBars_ShowScrollBar() somewhere between the Do/Until-Loop,

but this isn't a real solution...

Yeah I just noticed that... Better try picea892's way.

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

I have no repaint problem... (V3.3.0.0)

Edited by supersonic

Share this post


Link to post
Share on other sites

On this example neither do I...must have been GDI related in this post. redraw control

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  
Followers 0