Sl4yer Posted August 31, 2008 Posted August 31, 2008 (edited) Why does "GUICtrlRead($dlistView)" return "6" when the first entry (c: | ntfs) is selected??? note: the function GUICtrlRead is called after a button is submitted $dlistView = GuiCtrlCreateListView("Laufwerk|Dateisystem|", 20, 40, 200, 60) $dVar = DriveGetDrive( "fixed" ) If NOT @error Then For $i = 1 to $dVar[0] $dglVar1 = DriveGetFileSystem($dVar[$i] & "\" ) GuiCtrlCreateListViewItem($dVar[$i] & "|" & $dglVar1, $dlistView) Next EndIf pls help Edited August 31, 2008 by Sl4yer
AdmiralAlkex Posted August 31, 2008 Posted August 31, 2008 Using GUICtrlRead() on a ListView returns the control-id of the selected ListViewItem!!ListView | Control identifier (controlID) of the selected ListViewItem. 0 means no item is selected .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface
Achilles Posted August 31, 2008 Posted August 31, 2008 You'd want to combine the index with a _GUICtrlListView_GetItemText My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
rasim Posted August 31, 2008 Posted August 31, 2008 Sl4yerExample:#include <GuiConstantsEx.au3> $hGUI = GUICreate("Test", 300, 200) $hListView = GUICtrlCreateListView("Items|SubItems", 10, 10, 280, 160) For $i = 1 To 10 GUICtrlCreateListViewItem("Item " & $i & "|" & "SubItem " & $i, $hListView) Next $ReadButton = GUICtrlCreateButton("Read", 10, 173, 75, 23) GUISetState() While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE Exit Case $ReadButton ConsoleWrite(GUICtrlRead(GUICtrlRead($hListView)) & @LF) EndSwitch WEnd
Sl4yer Posted August 31, 2008 Author Posted August 31, 2008 (edited) You'd want to combine the index with a _GUICtrlListView_GetItemText yehaw! got it to work with the following: $ret = _GUICtrlListViewGetItemText($dlistView, _GUICtrlListViewGetSelectedIndices($dlistView)) If ($ret <> $LV_ERR) Then MsgBox(0, "Selected Item", $ret) $ret = _GUICtrlListViewGetItemText($dlistView, _GUICtrlListViewGetSelectedIndices($dlistView), 0) If ($ret <> $LV_ERR) Then MsgBox(0, "Selected Item, SubItem 0", $ret) EndIf Else GUICtrlSetData($Status, "Nothing Selected") EndIf thnx guys 4 ur help i appreciate it Edited August 31, 2008 by Sl4yer
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