icemax Posted December 7, 2008 Posted December 7, 2008 (edited) (help ListView & XML (load and search) )(how to dynamically insert and search items from XML file to ListView )Hello to all, I wanted help for insert items from XML file to ListView controlexample structure of listview : Group|ItemQuestions: 1 - I would like search items and group from 2 textbox ((item and group) and dynamically load to list2 - I want load the results found from txtbox (item and group) to listviewexample of use : a - insert text to "item" txtbox and code..search and load to listview -> the items and relative groupb- insert text to "GROUP" txtbox and code..search and load to listview -> the group and relative all items example XML file : <?xml version="1.0" encoding="ISO-8859-1"?> <menu title="XMLMenu"> <menu Group="Games"> <item caption="Sol Windows XP" cmd="sol.exe"/> <item caption="WinMine - XP Game" cmd="winmine.exe"/> </menu> <menu Group="Programs"> <item caption="Wordpad2" cmd="wordpad.exe"/> </menu> <menu Group="Others"> <item caption="reboot XP" cmd="reboot.exe"/> <item caption="RemoveWGA" cmd="\XP - WGA CRACK e Guida\RemoveWGA.exe"/> </menu>Thanks very much for answers Edited December 7, 2008 by icemax
rasim Posted December 7, 2008 Posted December 7, 2008 This? #include <GuiConstantsEx.au3> $sFile = @ScriptDir & "\test.xml" $sRead = FileRead($sFile) $aGroup = StringRegExp($sRead, '(?i)Group="(.*?)"', 3) If @error Then Exit $aItem = StringRegExp($sRead, '(?i)caption="(.*?)"', 3) If @error Then Exit $iUbound = UBound($aGroup) If UBound($aItem) > $iUbound Then $iUbound = UBound($aItem) GUICreate("XML to ListView demo", 300, 200) $ctlListView = GUICtrlCreateListView("Group|Item", 10, 10, 280, 180) For $i = 0 To $iUbound - 1 $strData = "" If UBound($aGroup) > $i Then $strData &= $aGroup[$i] If UBound($aItem) > $i Then $strData &= "|" & $aItem[$i] GUICtrlCreateListViewItem($strData, $ctlListView) Next GUISetState() Do Until GUIGetMsg() = $GUI_EVENT_CLOSE
Zedna Posted December 8, 2008 Posted December 8, 2008 Look at XML COM Wrapperhttp://www.autoitscript.com/forum/index.ph...9848&hl=xml Resources UDF ResourcesEx UDF AutoIt Forum Search
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