Jump to content

Can Listviews highlight multiple rows?


Recommended Posts

Is it possible to highlight multiple rows in a listview?

I would have thought given that there is a listview style called $LVS_SINGLESEL that multiple selections would be the default but apparently not?

#include <GUIConstants.au3>
#Include <GuiListView.au3>

$Form1 = GUICreate("", 824, 663, 200, 24)

$h_listview = GUICtrlCreateListView("OrderID|Name|DueBy|ReleaseTime|Job Status|", 4, 44, 816, 561)
GuiCtrlSetFont(-1,14,400,2)
_GUICtrlListViewSetColumnWidth ( $h_listview, 0, 150 )
_GUICtrlListViewSetColumnWidth ( $h_listview, 1, 150 )
_GUICtrlListViewSetColumnWidth ( $h_listview, 2, 200 )
_GUICtrlListViewSetColumnWidth ( $h_listview, 3, 200 )
_GUICtrlListViewSetColumnWidth ( $h_listview, 4, 100 )

GUICtrlCreateListViewItem("0|0|0|0|0",$h_listview)
GUICtrlCreateListViewItem("1|1|1|1|1",$h_listview)
GUICtrlCreateListViewItem("2|2|2|2|2",$h_listview)
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        
        Case Else
        ;;
    EndSwitch
WEnd
Link to comment
Share on other sites

The defualts for the GUICtrlCreateListView() function make it only single select. To override this try-

$h_listview = GUICtrlCreateListView("OrderID|Name|DueBy|ReleaseTime|Job Status|", 4, 44, 816, 561,$LVS_SHOWSELALWAYS)

Which manually tells it parameters for the style (not letting it assign the defaults)

Cool Thanks
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...