Didonet Posted November 5, 2007 Posted November 5, 2007 (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 November 5, 2007 by Didonet
Achilles Posted November 5, 2007 Posted November 5, 2007 Try this. My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
Didonet Posted November 5, 2007 Author Posted November 5, 2007 I can't get it... i try the method on this topic with the "GuiCtrlCreateListView", but with the "GuiCtrlCreteList" it does'nt work.
Didonet Posted November 6, 2007 Author Posted November 6, 2007 Is it possible... or to work with the GuiCtrlCreateListView...?
Achilles Posted November 6, 2007 Posted November 6, 2007 (edited) I'm sure it's possible but I can't find the post where I read it... Found it. Look here #405450 Edited November 6, 2007 by Piano_Man My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
smashly Posted November 6, 2007 Posted November 6, 2007 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
Didonet Posted November 6, 2007 Author Posted November 6, 2007 thanks... and what about duble click and the "no border" effect?
smashly Posted November 6, 2007 Posted November 6, 2007 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now