Sign in to follow this  
Followers 0
zabimaru27

fill a listbox from file

6 posts in this topic

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



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

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

#4 ·  Posted (edited)

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

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

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

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