Jump to content
Sign in to follow this  
lemony

Remove an entry from a Listbox by doubleclicking

Recommended Posts

Hey guys,

I basically need to do exactly as the title says.

I created a listbox on a GUI. I want to be able to remove entries from the listbox by double-clicking on them.

Is this possible at all?

You don't have to waste too much of your time with me. Don't worry about making a whole example script. All I need is for someone to point me in the right direction and I should be able to figure out the rest on my own :)

Thanks!

Share this post


Link to post
Share on other sites

Can do something like the clear button does jsut repopulate the list - the value you want deleated

#include <GUIConstants.au3>

GLOBAL $MESSAGE = "The following buttons have been clicked"
GUICreate("My GUI list") ; will create a dialog box that when displayed is centered

$add=GUICtrlCreateButton ("Add", 64,32,75,25)
$clear=GUICtrlCreateButton ("Clear", 64,72,75,25)
$mylist=GUICtrlCreateList ("buttons that have been clicked", 176,32,121,97)
GUICtrlSetLimit(-1,200) ; to limit horizontal scrolling
GUICtrlSetData(-1,$MESSAGE)
$close=GUICtrlCreateButton ("my closing button", 64,160,175,25)

GUISetState ()

$msg = 0
While $msg <> $GUI_EVENT_CLOSE
    $msg = GUIGetMsg()

    Select
         case $msg = $add
        GUICtrlSetData($mylist,"You clicked button No1|")
         case $msg = $clear
        GUICtrlSetData($mylist,"")
         Case $msg = $close
            MsgBox(0,"", "the closing button has been clicked",2)
            Exit
    EndSelect
Wend

Share this post


Link to post
Share on other sites

Look into GUIRegisterMsg()

Thanks Generator, that's the one :(

botanic, thanks for your reply also... although I don't think you even read what I wrote :)

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  

×
×
  • Create New...