Tiger Posted August 14, 2007 Share Posted August 14, 2007 How can I count the selected items in a listview. My UDFs:- _RegEnumKey Link to comment Share on other sites More sharing options...
Gif Posted August 14, 2007 Share Posted August 14, 2007 How can I count the selected items in a listview. #include <Guilistview.au3> _GUICtrlListViewGetSelectedCount() Link to comment Share on other sites More sharing options...
Tiger Posted August 17, 2007 Author Share Posted August 17, 2007 #include <GuiConstants.au3> #include <GuiListView.au3> Opt ('MustDeclareVars', 1) Dim $listview, $Btn_Exit, $msg, $Status, $pos GUICreate("ListView Get Selected Count", 392, 322) $listview = GUICtrlCreateListView("col1|col2|col3", 40, 30, 310, 149, "", $LVS_EX_CHECKBOXES) GUICtrlCreateListViewItem("line1|data1|more1", $listview) GUICtrlCreateListViewItem("line2|data2|more2", $listview) GUICtrlCreateListViewItem("line3|data3|more3", $listview) GUICtrlCreateListViewItem("line4|data4|more4", $listview) GUICtrlCreateListViewItem("line5|data5|more5", $listview) $Btn_Exit = GUICtrlCreateButton("Exit", 150, 260, 70, 30) $Status = GUICtrlCreateLabel("", 0, 302, 392, 20, BitOR($SS_SUNKEN, $SS_CENTER)) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Or $msg = $Btn_Exit ExitLoop Case $msg = $GUI_EVENT_PRIMARYDOWN $pos = GUIGetCursorInfo() If ($pos[4] == $listview) Then GUICtrlSetData($Status, "Selected Count: " & _GUICtrlListViewGetSelectedCount ($listview)) EndIf EndSelect WEnd Exit How can I count the selected items in the listview in the script My UDFs:- _RegEnumKey Link to comment Share on other sites More sharing options...
Zedna Posted August 17, 2007 Share Posted August 17, 2007 (edited) If you want to react to selection change in ListView then useGUIRegisterMsg with WM_NOTIFY and LVN_ITEMCHANGEDSearch forum for these keywords for examples ...EDIT:here is the MSDN link Edited August 17, 2007 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Tiger Posted August 23, 2007 Author Share Posted August 23, 2007 I don't understand what you mean My UDFs:- _RegEnumKey Link to comment Share on other sites More sharing options...
Zedna Posted August 23, 2007 Share Posted August 23, 2007 I don't understand what you meanI said what you should do:Search forum for these keywords for examples ... Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Tiger Posted August 23, 2007 Author Share Posted August 23, 2007 OK. I have searched, but I found nothing My UDFs:- _RegEnumKey Link to comment Share on other sites More sharing options...
randallc Posted August 23, 2007 Share Posted August 23, 2007 OK. I have searched, but I found nothingHi, Your sacript works with $listview = GUICtrlCreateListView("col1|col2|col3", 40, 30, 310, 149, BitOR($LVS_SHOWSELALWAYS, $LVS_NOSORTHEADER))so you need to work on how to avoid turning off slections... Best, randall ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now