Sign in to follow this  
Followers 0
Trax

ListView Cosmetics

5 posts in this topic

I have a three column ListView. All three columns are linked. The only scroll bar that is "active" is on column one. The scroll bar is also on column 2 and 3 but doesn't work (as was intended). Is there any way to turn off the scroll bar on columns 2 and 3 so it isn't even visible?

Share this post


Link to post
Share on other sites



Trax,

I have never seen a ListView with scrollbars for each column. Can you please post the code you are using to create it. :wacko:

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <EditConstants.au3>
#include <Constants.au3>
#include <GUIListBox.au3>
#include <GUIEdit.au3>
#include <GuiListView.au3>
#include <Array.au3>
#include <ButtonConstants.au3>
#include <ScrollBarConstants.au3>
#include <MsgBoxConstants.au3>
#include <Misc.au3>
#include <File.au3>
#include <GuiScrollBars.au3>
#include <GuiHeader.au3>

Local $Index, $LV1, $LV2, $LV3, $L1_EX, $L2_EX, $L3_EX

Create_Listview()

While 1
   Sleep(5000)
WEnd

Func Create_Listview()
    Local $Index, $LV1, $LV2, $LV3, $L1_EX, $L2_EX, $L3_EX
    $GUIhandle = GUICreate("ListView", 680, 575, -1, -1, $WS_SIZEBOX + $WS_SYSMENU + $WS_MAXIMIZEBOX + $WS_MINIMIZEBOX) ;creates the parent window
    $List1 = GUICtrlCreateListView("Computer Name ", 20, 35, 300, 448, -1, $LVS_EX_DOUBLEBUFFER)
    $cLabel_1 = GUICtrlCreateLabel("", 20, 35, 300, 448)
    GUICtrlSetState($cLabel_1, $GUI_DISABLE)
    GUICtrlSetResizing($cLabel_1, $GUI_DOCKAUTO)
    GUICtrlSetBkColor($cLabel_1, $GUI_BKCOLOR_TRANSPARENT)
    _GUICtrlListView_SetExtendedListViewStyle($List1, $LVS_EX_TWOCLICKACTIVATE)
    $List2 = GUICtrlCreateListView("Date/Time", 355, 35, 190, 450, -1, $LVS_EX_DOUBLEBUFFER)
    $cLabel_2 = GUICtrlCreateLabel("", 355, 35, 190, 450)
    GUICtrlSetState($cLabel_2, $GUI_DISABLE)
    GUICtrlSetResizing($cLabel_2, $GUI_DOCKAUTO)
    GUICtrlSetBkColor($cLabel_2, $GUI_BKCOLOR_TRANSPARENT)
    $List3 = GUICtrlCreateListView("RPM", 574, 35, 95, 450, -1, $LVS_EX_DOUBLEBUFFER)
    $cLabel_3 = GUICtrlCreateLabel("", 574, 35, 95, 450)
    GUICtrlSetState($cLabel_3, $GUI_DISABLE)
    GUICtrlSetResizing($cLabel_3, $GUI_DOCKAUTO)
    GUICtrlSetBkColor($cLabel_3, $GUI_BKCOLOR_TRANSPARENT)
    GUISetState(@SW_SHOW) ;shows the GUI window
    For $Index = 0 To 50
        _GUICtrlListView_AddItem($List1, "Name " & $Index)
        _GUICtrlListView_AddItem($List2, "1:00 pm")
        _GUICtrlListView_AddItem($List3, $Index)
    Next
EndFunThe code and the screenshot are attached.

The code and the screenshot are attached. Column 2 and 3 are linked to column 1 so what I ultimately want to do is get rid of the scroll bar all together on columns 2 and 3. I would also like to take the headers on all three columns to the full column width right off the bat if that is possible. Thanks!

post-86678-0-29962100-1414786952_thumb.p

Share this post


Link to post
Share on other sites

Trax,

That is 3 separate ListViews. If they are all linked, why not make them into a single ListView like this? :huh:

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

Create_Listview()

While 1
   Sleep(5000)
WEnd

Func Create_Listview()
    Local $LV1
    $GUIhandle = GUICreate("ListView", 680, 575, -1, -1, $WS_SIZEBOX + $WS_SYSMENU + $WS_MAXIMIZEBOX + $WS_MINIMIZEBOX) ;creates the parent window

    $List1 = GUICtrlCreateListView("Computer Name|Date/Time|RPM", 20, 35, 580, 448, -1, $LVS_EX_DOUBLEBUFFER)
    _GUICtrlListView_SetColumnWidth($List1, 0, 300)
    _GUICtrlListView_SetColumnWidth($List1, 1, 190)
    _GUICtrlListView_SetColumnWidth($List1, 2, 73)

    $cLabel_1 = GUICtrlCreateLabel("", 20, 35, 580, 448)
    GUICtrlSetState($cLabel_1, $GUI_DISABLE)
    GUICtrlSetResizing($cLabel_1, $GUI_DOCKAUTO)
    GUICtrlSetBkColor($cLabel_1, $GUI_BKCOLOR_TRANSPARENT)
    _GUICtrlListView_SetExtendedListViewStyle($List1, $LVS_EX_TWOCLICKACTIVATE)

    GUISetState(@SW_SHOW) ;shows the GUI window

    For $Index = 0 To 50
        GUICtrlCreateListViewItem("Name " & $Index & "|1:00 pm|" & $Index, $List1)
    Next

EndFunc
Now you have the one scrollbar you wanted. :)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

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