Sign in to follow this  
Followers 0
Didonet

Click on item in a list

8 posts in this topic

#1 ·  Posted (edited)

Is it possible when i click on an item in some GUICtrlCreateList to do something?

For example this script:

$playlist=GUICtrlCreateList("", 0,$programHeight-149, $programWidth, $programHeight-155, $WS_VSCROLL ,$SS_WHITERECT)
GUICtrlSetLimit(-1,200)
$FileList=_FileListToArray(@DesktopDir, '*.mp3', 1)
For $i = 1 to $FileList[0]
    GuiCtrlSetData($playlist, $i & ". " &$FileList[$i])
Next

When i click on some MP3 to show a msgbox with the mp3's name? I tryed with If $msg = $playlist... but it doesnt work.

Edited by Didonet

Share this post


Link to post
Share on other sites



I can't get it... i try the method on this topic with the "GuiCtrlCreateListView", but with the "GuiCtrlCreteList" it does'nt work. <_<

Share this post


Link to post
Share on other sites

Is it possible... or to work with the GuiCtrlCreateListView...?

Share this post


Link to post
Share on other sites

The reason your Listbox click isn't registering is because of the "$SS_WHITERECT" control style your using on the ListBox....

Remove that style and the list box works with a single click with GuiGetMsg().

#include <GUIConstants.au3>
#include <File.au3>

$Gui = GUICreate("Video Control", 320, 220)
$List = GUICtrlCreateList("", 10, 10, 300, 200, $WS_VSCROLL)
$FL2A =_FileListToArray(@WindowsDir & "\Media", '*.wav', 1)
For $i = 1 to $FL2A[0]
    GuiCtrlSetData($List, $i & ". " & $FL2A[$i])
Next
GUISetState()

While 1
    $msg = GUIGetMsg()
    Switch $msg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $List
            MsgBox(64, "Selected Wav", GUICtrlRead($List))
    EndSwitch
WEnd

Cheers

Share this post


Link to post
Share on other sites

thanks... and what about duble click and the "no border" effect? <_<

Share this post


Link to post
Share on other sites

Hi,

What about double click? .. you didn't mention double click anywhere in your original post..

It's sorta hard to guess what you want when you don't state it clearly and when you provide only incomplete non working code to start with..

So what exactly are you trying to do?

Cheers

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