PINTO1927 Posted September 3, 2016 Share Posted September 3, 2016 Hi guys, through _GUICtrlListView GetItemText String formula you can only get the contents of a cell? example: #include <GUIConstantsEx.au3> #include <GuiListView.au3> #include <MsgBoxConstants.au3> Example() Func Example() Local $idListview GUICreate("ListView Get Item Text String", 400, 300) $idListview = GUICtrlCreateListView("col1|col2|col3", 2, 2, 394, 268) GUICtrlCreateListViewItem("line1|data1|more1", $idListview) GUICtrlCreateListViewItem("line2|data2|more2", $idListview) GUICtrlCreateListViewItem("line3|data3|more3", $idListview) GUICtrlCreateListViewItem("line4|data4|more4", $idListview) GUICtrlCreateListViewItem("line5|data5|more5", $idListview) GUISetState(@SW_SHOW) MsgBox($MB_SYSTEMMODAL, "Information", "Item 2 Text: " & @CRLF & @CRLF & _GUICtrlListView_GetItemTextString($idListview, 1)) ; Loop until the user exits. Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() EndFunc ;==>Example In the MsgBox I would like to show only, for example, "data3", and not all the content of the line3. Link to comment Share on other sites More sharing options...
BugFix Posted September 3, 2016 Share Posted September 3, 2016 Use _GUICtrlListView_GetItemText to get the text from a sub item. Best Regards BugFix Link to comment Share on other sites More sharing options...
PINTO1927 Posted September 3, 2016 Author Share Posted September 3, 2016 I tried to use it but it does not show what I was looking #include <GUIConstantsEx.au3> #include <GuiListView.au3> #include <MsgBoxConstants.au3> Example() Func Example() Local $idListview GUICreate("ListView Get Item Text", 400, 300) $idListview = GUICtrlCreateListView("test|test|test", 2, 2, 394, 268) GUICtrlCreateListViewItem("line1|data1|more1", $idListview) GUICtrlCreateListViewItem("line2|data2|more2", $idListview) GUICtrlCreateListViewItem("line3|data3|more3", $idListview) GUISetState(@SW_SHOW) MsgBox($MB_SYSTEMMODAL, "Information", _GUICtrlListView_GetItemText($idListview, 1)) Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() EndFunc Link to comment Share on other sites More sharing options...
PINTO1927 Posted September 3, 2016 Author Share Posted September 3, 2016 solved, thanks a lot Link to comment Share on other sites More sharing options...
ROBINHOOD3 Posted April 30, 2019 Share Posted April 30, 2019 Hello partner, and to read the whole column? Link to comment Share on other sites More sharing options...
ROBINHOOD3 Posted April 30, 2019 Share Posted April 30, 2019 #include <GUIConstantsEx.au3> #include <GuiListView.au3> #include <MsgBoxConstants.au3> Example() Func Example() Local $idListview GUICreate("ListView Get Item Text String", 400, 300) $idListview = GUICtrlCreateListView("", 2, 2, 394, 268) _GUICtrlListView_AddColumn(GUICtrlGetHandle($idListview), "ESTADO", 100) _GUICtrlListView_AddColumn(GUICtrlGetHandle($idListview), "PRUEBA", 100) For $s = 0 to 5 _GUICtrlListView_AddItem(GUICtrlGetHandle($idListview), "ESTADO" & $s) _GUICtrlListView_AddSubItem(GUICtrlGetHandle($idListview), $s, "PRUEBA" & $s, 1) Next GUISetState(@SW_SHOW) MsgBox($MB_SYSTEMMODAL, "Information", _GUICtrlListView_GetItemTextString(GUICtrlGetHandle($idListview))) Exit ; Loop until the user exits. Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() EndFunc ;==>Example Link to comment Share on other sites More sharing options...
Nine Posted April 30, 2019 Share Posted April 30, 2019 Something like this : Local $nRows = _GUICtrlListView_GetItemCount($idListview) Local $aCol [$nRows], $iColToGet = 1 For $i = 0 to $nRows-1 $aCol[$i] = _GUICtrlListView_GetItemText ($idListview,$i,$iColToGet) Next _ArrayDisplay ($aCol) ROBINHOOD3 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy 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