mkmcst Posted September 29, 2009 Share Posted September 29, 2009 (edited) hi i have a Question i'm doing a scan and i was trying to put the results on the scan in a listbox i thought we use the GUICtrlSetData ? but it dose not to seem to work for me or it could be i'm just not understanding how to use it the right way i would like to fill the listbox with the _ArrayDisplay ($aResults) but know luck yet func scann() $spath = "c:\" $sRequest = "*.txt" $aResults = _FileSearch($sPath, $sRequest, 1, 0) If @error Then MsgBox(48, "Attention!", "No files found.") Else GUICtrlSetData($Llist ,$aResults) _ArrayDisplay ($aResults) EndIf endfunc Edited September 30, 2009 by mkmcst ^SLEEPY^sleepys-sin scripting Link to comment Share on other sites More sharing options...
mkmcst Posted September 30, 2009 Author Share Posted September 30, 2009 i was wondering what the -1 ment in the GUICtrlSetData something to do with error ?? GUICtrlSetData(-1, , ) i cant seem to fig out how to fill the listbox with the GUICtrlSetData hmmmmmm hi i have a Question i'm doing a scan and i was trying to put the results on the scan in a listbox i thought we use the GUICtrlSetData ? but it dose not to seem to work for me or it could be i'm just not understanding how to use it the right way i would like to fill the listbox with the _ArrayDisplay ($aResults) but know luck yet func scann() $spath = "c:\" $sRequest = "*.txt" $aResults = _FileSearch($sPath, $sRequest, 1, 0) If @error Then MsgBox(48, "Attention!", "No files found.") Else GUICtrlSetData($Llist ,$aResults) _ArrayDisplay ($aResults) EndIf endfunc ^SLEEPY^sleepys-sin scripting Link to comment Share on other sites More sharing options...
water Posted September 30, 2009 Share Posted September 30, 2009 GUICtrlSetData requires the ControlId as first parameter. -1 means "use the last used ControlId". My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
furrycow Posted September 30, 2009 Share Posted September 30, 2009 (edited) Altho GUICtrlSetData() works with a ListView control, it is a whole lot easier to just use one of these funcs (depending on how you want to add it)_GUICtrlListView_AddArray($hWnd, ByRef $aItems) ;OR _GUICtrlListView_AddItem($hWnd, $sText[, $iImage = -1[, $iParam = 0]]) ;AND _GUICtrlListView_AddSubItem($hWnd, $iIndex, $sText, $iSubItem[, $iImage = -1])remember to include <GuiListView.au3>Just search the above funcs in the help file.EDIT: Just seen youre reffering to a Listbox..my mistake, ha, well if GUICtrlSetData()'s not working for you, you could always try... _GUICtrlListBox_AddString()..GOOD LUCK! Edited September 30, 2009 by furrycow Instant Lockerz Invite - www.instantlockerzinvite.co.uk Link to comment Share on other sites More sharing options...
mkmcst Posted September 30, 2009 Author Share Posted September 30, 2009 ok thank you guys for the replys i'll see what i can do i'm sure i'll fig it out one way or the other might take me a few days lol Altho GUICtrlSetData() works with a ListView control, it is a whole lot easier to just use one of these funcs (depending on how you want to add it) _GUICtrlListView_AddArray($hWnd, ByRef $aItems) ;OR _GUICtrlListView_AddItem($hWnd, $sText[, $iImage = -1[, $iParam = 0]]) ;AND _GUICtrlListView_AddSubItem($hWnd, $iIndex, $sText, $iSubItem[, $iImage = -1]) remember to include <GuiListView.au3> Just search the above funcs in the help file. EDIT: Just seen youre reffering to a Listbox..my mistake, ha, well if GUICtrlSetData()'s not working for you, you could always try... _GUICtrlListBox_AddString()..GOOD LUCK! ^SLEEPY^sleepys-sin scripting 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