Sign in to follow this  
Followers 0
mkmcst

listbox Question

5 posts in this topic

#1 ·  Posted (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 by mkmcst

Share this post


Link to post
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

Share this post


Link to post
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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#4 ·  Posted (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 by furrycow

Instant Lockerz Invite - www.instantlockerzinvite.co.uk

Share this post


Link to post
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!

Share this post


Link to post
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
Sign in to follow this  
Followers 0