Jump to content
Sign in to follow this  
zabimaru27

fill a listbox from file

Recommended Posts

zabimaru27

Hi everybody

My problem is i generated the following empty template

#include <GUIListBox.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=\\dmhd003\463036$\workarea\autoit\koda_2008-10-03\forms\test.kxf
$Form1_1 = GUICreate("Form1", 633, 569, 191, 123)
$List1 = GUICtrlCreateList("", 8, 40, 249, 513)
$Label1 = GUICtrlCreateLabel("Liste des Serveurs", 8, 8, 91, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

that just display an empty listbox.

I would like to know how to fill it with data contained in a file, line by line.

Does it's complicated, cause , i know a little autoIt language but i'm a big noob with graphical function.

Thanks in advance

Share this post


Link to post
Share on other sites
water

I would like to know how to fill it with data contained in a file, line by line.

Something like that?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
zabimaru27

Hummm

thanks, but in fact i don't really understand what does this code.

And it seem to be for a list view, and not for a listbox ??? no ?

If someone nice could write me this code and explain me this strange process

thanks

Share this post


Link to post
Share on other sites
water

You're right. So this posting might help.

Replace GuiCtrlCreateCombo with GUICtrlCreateList.

To see how it works - and to improve your autoit knowledge - please have a look in the help file for the functions in question.

Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
zabimaru27

Thanks , it's working very well.

Just one question.

It seems than the "GUICtrlSetData" function is working for the last item created.

How can i use it for a specific box created earlier in the program ??

thanks

Share this post


Link to post
Share on other sites
water

Instead of -1 as the controlID for the GUICtrlSetData use the handle returned by GUICtrlCreateList ($List1 in your first example).


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

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  

×