- 1 a Listbox
- The other a Listview
When I click on the Listbox item, I want the Listview to populate the first column with data stored in an ini file. The problem is the Listview never gets populated with items from the ini file.
AutoIt
#include <ButtonConstants.au3> #include <ComboConstants.au3> #include <GUIConstantsEx.au3> #include <GUIListBox.au3> #include <GUIListView.au3> #include <WindowsConstants.au3> Global $listBuilding, $listRoom Global $lb, $lr, $lrText, $p $Form1 = GUICreate("Form1", 396, 371, 192, 124) $listBuilding = GUICtrlCreateList("", 16, 40, 169, 292) GUICtrlSetData(-1, "Test|Alpha|Beta") $listRoom = _GUICtrlListView_Create($Form1, "", 204, 42, 169, 292) $btnConnect = GUICtrlCreateButton("Connect", 296, 336, 75, 25) GUISetState(@SW_SHOW) #endregion ### END Koda GUI section ### While 1 $lb = GUICtrlRead($listBuilding) If $lb = "Admin" Then $lr = IniReadSection("[url="file://\\app2\apps$\K-12\Projectors\projectors.ini"]C:\projectors.ini[/url]", "Test") For $p = 1 To $lr[0][0] $lrText = _GUICtrlListView_GetItemText($listRoom, $p - 1) MsgBox(0, "", "Loop: " & $p & @CR & "Listview item text: " & $lrText & @CR & "ini list for Projector: " & $lr[$p][0]) If $lr[$p][0] = $lrText Then MsgBox(0, "", "Match") Sleep(1);MsgBox(0, "", _GUICtrlListView_GetItemText($listRoom, $p) & @CR & @error) Else MsgBox(0, "", "No Match") _GUICtrlListView_AddItem($listRoom, $lr[$p][0]) EndIf Next Wend
Because I have this in a while loop I have it so that if the item matches whats already in the listview, it just sleeps briefly. If they don't match, then the listview item is added.
I appreciate any help.





