Sign in to follow this  
Followers 0
anystupidassname

listbox

3 posts in this topic

Hi,

I've looked and there are multiple listbox examples, but I couldn't find one to help me with my situation.

I have a GUI that is created with only the listbox and a list of items. I'd like the window to exit the script if closed or set a variable and close and go on to do the rest of my script (which includes another gui) if a listed item is clicked on. Thanks for any help!

GuiCreate("Day/URL Tool", 280, 349,(@DesktopWidth-280)/2, (@DesktopHeight-349)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)

$List_1 = GuiCtrlCreateList("", 0, 40, 280, 305)
GUICtrlSetData($List_1, "1|2")
$Label_1 = GuiCtrlCreateLabel("Choose a crossword puzzle provider:", 10, 10, 180, 20)

GuiSetState()
While 1
    $msg = GuiGetMsg()
    Sleep(100)
    Select
    Case $msg = $List_1
            $L = GUICtrlRead($List_1)
        ;MsgBox(0,"",$L)
        ;ExitLoop
    Case $msg = $GUI_EVENT_CLOSE
            Exit
    Case Else
    EndSelect
WEnd
GUISetState(@SW_HIDE)
...

This is what I have but I'm thinking I need to use oneventmode or something.


This signature is computer generated, nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#.......

Share this post


Link to post
Share on other sites



...

    Case $msg = $List_1

            $L = GUICtrlRead($List_1)

        ;MsgBox(0,"",$L)

        ;ExitLoop ???

...

And that line don't it solves? :whistle:

Share this post


Link to post
Share on other sites

And that line don't it solves?  :whistle:

<{POST_SNAPBACK}>

Thanks. I ended up doing it a little differently though. The ExitLoop was commented out because I was trying to use a GUISetOnEvent.

This signature is computer generated, nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#.......

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