Jump to content

listbox Question


mkmcst
 Share

Recommended Posts

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 by mkmcst
Link to comment
Share on other sites

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 :D

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

Link to comment
Share on other sites

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 - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

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 by furrycow
Instant Lockerz Invite - www.instantlockerzinvite.co.uk
Link to comment
Share on other sites

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 :D 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!

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...