Jump to content

Empty list


YuChan
 Share

Recommended Posts

hello, have this :

Global $GUIlisteConfirmChoix = GUICreate("Confirmer le choix", 314, 162, 1030, 290, -1, $WS_EX_TOPMOST)
    $GroupBoxConfirmChoix = GUICtrlCreateGroup("", 8, 1, 297, 121)
    Global $listeConfirmChoix = GUICtrlCreateList("", 96, 16, 121, 97, BitAND($GUI_SS_DEFAULT_LIST, $LBS_SORT))
    GUICtrlSetData(-1, "MENU 1|MENU 2|MENU 3")
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $listeChoixConfirmOK = GUICtrlCreateButton("&OK", 65, 131, 75, 25)
    Global $listeChoixConfirmCANCEL = GUICtrlCreateButton("&Cancel", 162, 131, 75, 25)
    GUISetState(@SW_SHOW)

#EndRegion ### END Koda GUI section ###
$read = GUICtrlRead($listeConfirmChoix)
ConsoleWrite("text = " & $read)

Why $read is empty ?

Please help me

Link to comment
Share on other sites

Its because you need to select an item first for example:

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <ListBoxConstants.au3>

    Global $GUIlisteConfirmChoix = GUICreate("Confirmer le choix", 314, 162, 1030, 290, -1, $WS_EX_TOPMOST)
    GUICtrlCreateGroup("", 8, 1, 297, 121)
        Global $listeConfirmChoix = GUICtrlCreateList("", 96, 16, 121, 97, BitAND($GUI_SS_DEFAULT_LIST, $LBS_SORT))
        GUICtrlSetData(-1, "MENU 1|MENU 2|MENU 3", "MENU 1")
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    Global $listeChoixConfirmOK = GUICtrlCreateButton("&OK", 65, 131, 75, 25)
    Global $listeChoixConfirmCANCEL = GUICtrlCreateButton("&Cancel", 162, 131, 75, 25)
    GUISetState(@SW_SHOW)
    $read = GUICtrlRead($listeConfirmChoix)
    ConsoleWrite("text = " & $read & @CRLF)

    While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE, $listeChoixConfirmCANCEL
                ExitLoop
            Case $listeChoixConfirmOK
                $read = GUICtrlRead($listeConfirmChoix)
                ConsoleWrite("text = " & $read & @CRLF)
        EndSwitch
    WEnd

 

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