ERIC_DEUCHER Posted November 29, 2023 Share Posted November 29, 2023 (edited) I recently started using AutoIt, so go easy on me, haha. I created a GUI with some information on the screen, but I can't figure out how to make it so that when I select a ListViewItem, it updates the value in GUICtrlCreateInput. my code: expandcollapse popup#include <FileConstants.au3> #include <MsgBoxConstants.au3> #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <GUIListBox.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <ListViewConstants.au3> Opt("TrayMenuMode", 1) #Region ### START Koda GUI section ### $Form1 = GUICreate("Iniciar", 317, 608, 417, 120) local $bone_id, $aur_id $Write_screen_1 = GUICtrlCreateLabel("CAC ID", 16, 64, 105, 20) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") $Write_screen_2 = GUICtrlCreateLabel("Aura ID", 40, 288, 48, 20) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") $Start_Convert = GUICtrlCreateButton("Start_Convert", 16, 432, 283, 105) $Dire_Tel = GUICtrlCreateLabel("...", 8, 552, 305, 52) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") $RE_cac_ID = GUICtrlCreateInput("", 16, 88, 105, 24) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") $RE_aura_ID = GUICtrlCreateInput("", 16, 312, 105, 24) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") ;ListView GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 40) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 100) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") GUICtrlSetResizing(-1, $GUI_DOCKRIGHT) $ListView1_Bon = GUICtrlCreateListView("ID|Name", 144, 8, 154, 193) $ListView1_CAC_1 = GUICtrlCreateListViewItem("64|Human Male", $ListView1_Bon) $ListView1_CAC_2 = GUICtrlCreateListViewItem("65|Human Female", $ListView1_Bon) $ListView1_CAC_3 = GUICtrlCreateListViewItem("66|Saiyan Male", $ListView1_Bon) $ListView1_CAC_4 = GUICtrlCreateListViewItem("67|Saiyan Female", $ListView1_Bon) $ListView1_CAC_5 = GUICtrlCreateListViewItem("68|Namekian", $ListView1_Bon) $ListView1_CAC_6 = GUICtrlCreateListViewItem("69|Frieza Race", $ListView1_Bon) $ListView1_CAC_7 = GUICtrlCreateListViewItem("6a|Majin Male", $ListView1_Bon) $ListView1_CAC_8 = GUICtrlCreateListViewItem("6b|Majin Female", $ListView1_Bon) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 40) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 60) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") $ListView2_Auras = GUICtrlCreateListView("ID|Name", 144, 208, 154, 214) $ListView2_aura_1 = GUICtrlCreateListViewItem("0|Blue", $ListView2_Auras) $ListView2_aura_2 = GUICtrlCreateListViewItem("1|Violet", $ListView2_Auras) $ListView2_aura_3 = GUICtrlCreateListViewItem("2|Purple", $ListView2_Auras) $ListView2_aura_4 = GUICtrlCreateListViewItem("3|Pink", $ListView2_Auras) $ListView2_aura_5 = GUICtrlCreateListViewItem("4|Red", $ListView2_Auras) $ListView2_aura_6 = GUICtrlCreateListViewItem("5|Yellow", $ListView2_Auras) $ListView2_aura_7 = GUICtrlCreateListViewItem("A|Green", $ListView2_Auras) $ListView2_aura_8 = GUICtrlCreateListViewItem("F|white", $ListView2_Auras) $ListView2_aura_9 = GUICtrlCreateListViewItem("C|Empty", $ListView2_Auras) ;ListView GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $ListView1_CAC_1 $bone_id = 777 Case $Start_Convert Exit EndSwitch WEnd Edited November 29, 2023 by Melba23 Added code tags Link to comment Share on other sites More sharing options...
Solution Andreik Posted November 29, 2023 Solution Share Posted November 29, 2023 (edited) This can be a way to do it: expandcollapse popup;~ #include <FileConstants.au3> ;~ #include <MsgBoxConstants.au3> ;~ #include <ButtonConstants.au3> ;~ #include <EditConstants.au3> #include <GUIConstantsEx.au3> ;~ #include <GUIListBox.au3> ;~ #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <ListViewConstants.au3> #include <StructureConstants.au3> #include <GuiListView.au3> Opt("TrayMenuMode", 1) #Region ### START Koda GUI section ### $Form1 = GUICreate("Iniciar", 317, 608, 417, 120) local $bone_id, $aur_id $Write_screen_1 = GUICtrlCreateLabel("CAC ID", 16, 64, 105, 20) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") $Write_screen_2 = GUICtrlCreateLabel("Aura ID", 40, 288, 48, 20) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") $Start_Convert = GUICtrlCreateButton("Start_Convert", 16, 432, 283, 105) $Dire_Tel = GUICtrlCreateLabel("...", 8, 552, 305, 52) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") Global $RE_cac_ID = GUICtrlCreateInput("", 16, 88, 105, 24) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") Global $RE_aura_ID = GUICtrlCreateInput("", 16, 312, 105, 24) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") ;ListView GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 40) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 100) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") GUICtrlSetResizing(-1, $GUI_DOCKRIGHT) $ListView1_Bon = GUICtrlCreateListView("ID|Name", 144, 8, 154, 193) $ListView1_CAC_1 = GUICtrlCreateListViewItem("64|Human Male", $ListView1_Bon) $ListView1_CAC_2 = GUICtrlCreateListViewItem("65|Human Female", $ListView1_Bon) $ListView1_CAC_3 = GUICtrlCreateListViewItem("66|Saiyan Male", $ListView1_Bon) $ListView1_CAC_4 = GUICtrlCreateListViewItem("67|Saiyan Female", $ListView1_Bon) $ListView1_CAC_5 = GUICtrlCreateListViewItem("68|Namekian", $ListView1_Bon) $ListView1_CAC_6 = GUICtrlCreateListViewItem("69|Frieza Race", $ListView1_Bon) $ListView1_CAC_7 = GUICtrlCreateListViewItem("6a|Majin Male", $ListView1_Bon) $ListView1_CAC_8 = GUICtrlCreateListViewItem("6b|Majin Female", $ListView1_Bon) Global $hListview_Bon = GUICtrlGetHandle($ListView1_Bon) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 40) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 60) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") $ListView2_Auras = GUICtrlCreateListView("ID|Name", 144, 208, 154, 214) $ListView2_aura_1 = GUICtrlCreateListViewItem("0|Blue", $ListView2_Auras) $ListView2_aura_2 = GUICtrlCreateListViewItem("1|Violet", $ListView2_Auras) $ListView2_aura_3 = GUICtrlCreateListViewItem("2|Purple", $ListView2_Auras) $ListView2_aura_4 = GUICtrlCreateListViewItem("3|Pink", $ListView2_Auras) $ListView2_aura_5 = GUICtrlCreateListViewItem("4|Red", $ListView2_Auras) $ListView2_aura_6 = GUICtrlCreateListViewItem("5|Yellow", $ListView2_Auras) $ListView2_aura_7 = GUICtrlCreateListViewItem("A|Green", $ListView2_Auras) $ListView2_aura_8 = GUICtrlCreateListViewItem("F|white", $ListView2_Auras) $ListView2_aura_9 = GUICtrlCreateListViewItem("C|Empty", $ListView2_Auras) Global $hListview_Auras = GUICtrlGetHandle($ListView2_Auras) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### GUIRegisterMsg($WM_NOTIFY, 'WM_NOTIFY') While True Switch GUIGetMsg() Case $ListView1_CAC_1 $bone_id = 777 Case $GUI_EVENT_CLOSE, $Start_Convert Exit EndSwitch WEnd Func WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $wParam Local $tNMHDR = DllStructCreate($tagNMHDR, $lParam) Local $hWndFrom = HWnd($tNMHDR.hWndFrom) Local $tNMITEMACTIVATE Switch $tNMHDR.Code Case $NM_CLICK Switch $hWndFrom Case $hListview_Bon $tNMITEMACTIVATE = DllStructCreate($tagNMITEMACTIVATE, $lParam) GUICtrlSetData($RE_cac_ID, _GUICtrlListView_GetItemText($hWndFrom, $tNMITEMACTIVATE.Index)) Case $hListview_Auras $tNMITEMACTIVATE = DllStructCreate($tagNMITEMACTIVATE, $lParam) GUICtrlSetData($RE_aura_ID, _GUICtrlListView_GetItemText($hWndFrom, $tNMITEMACTIVATE.Index)) EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc By the way, I don't think you fully understand how -1 works as parameter for control IDs so it would be better to use real control IDs for now. For example you have this portion of code: $Dire_Tel = GUICtrlCreateLabel("...", 8, 552, 305, 52) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") Global $RE_cac_ID = GUICtrlCreateInput("", 16, 88, 105, 24) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") Global $RE_aura_ID = GUICtrlCreateInput("", 16, 312, 105, 24) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") ;ListView GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 40) ; <<< ----- what do you think it happens here? GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 100) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") GUICtrlSetResizing(-1, $GUI_DOCKRIGHT) $ListView1_Bon = GUICtrlCreateListView("ID|Name", 144, 8, 154, 193) Edited November 29, 2023 by Andreik ERIC_DEUCHER 1 When the words fail... music speaks. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 29, 2023 Moderators Share Posted November 29, 2023 ERIC_DEUCHER, Welcome to the AutoIt forums. When you post code in future please use Code tags - see here how to do it. Then you get a scrolling box and syntax colouring as you can see above now I have added the tags. Thanks in advance for your cooperation. And looking at the code it seems that you might not yet have read the Forum rules. Please read them now - particularly the bit about not discussing game automation. As this question is purely a data handling matter I have decided to let it run, but I suggest you think carefuly before asking more questions about game-related code. M23 ERIC_DEUCHER 1 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
ERIC_DEUCHER Posted November 29, 2023 Author Share Posted November 29, 2023 Thank you very much for helping me, Andreik, and moderator Melba23, I will make sure this doesn't happen again. Link to comment Share on other sites More sharing options...
Andreik Posted November 29, 2023 Share Posted November 29, 2023 (edited) You can achieve the same result with native functions as well: expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <ListViewConstants.au3> #include <StructureConstants.au3> Opt("TrayMenuMode", 1) #Region ### START Koda GUI section ### $Form1 = GUICreate("Iniciar", 317, 608, 417, 120) Global $bone_id, $aur_id, $RE_cac_ID, $RE_aura_ID, $hListview_Bon, $hListview_Auras $Write_screen_1 = GUICtrlCreateLabel("CAC ID", 16, 64, 105, 20) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") $Write_screen_2 = GUICtrlCreateLabel("Aura ID", 40, 288, 48, 20) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") $Start_Convert = GUICtrlCreateButton("Start_Convert", 16, 432, 283, 105) $Dire_Tel = GUICtrlCreateLabel("...", 8, 552, 305, 52) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") $RE_cac_ID = GUICtrlCreateInput("", 16, 88, 105, 24) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") $RE_aura_ID = GUICtrlCreateInput("", 16, 312, 105, 24) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") ;ListView $ListView1_Bon = GUICtrlCreateListView("ID|Name", 144, 8, 154, 193) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 40) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 100) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") GUICtrlSetResizing(-1, $GUI_DOCKRIGHT) $ListView1_CAC_1 = GUICtrlCreateListViewItem("64|Human Male", $ListView1_Bon) $ListView1_CAC_2 = GUICtrlCreateListViewItem("65|Human Female", $ListView1_Bon) $ListView1_CAC_3 = GUICtrlCreateListViewItem("66|Saiyan Male", $ListView1_Bon) $ListView1_CAC_4 = GUICtrlCreateListViewItem("67|Saiyan Female", $ListView1_Bon) $ListView1_CAC_5 = GUICtrlCreateListViewItem("68|Namekian", $ListView1_Bon) $ListView1_CAC_6 = GUICtrlCreateListViewItem("69|Frieza Race", $ListView1_Bon) $ListView1_CAC_7 = GUICtrlCreateListViewItem("6a|Majin Male", $ListView1_Bon) $ListView1_CAC_8 = GUICtrlCreateListViewItem("6b|Majin Female", $ListView1_Bon) $hListview_Bon = GUICtrlGetHandle($ListView1_Bon) $ListView2_Auras = GUICtrlCreateListView("ID|Name", 144, 208, 154, 214) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 40) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 60) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") $ListView2_aura_1 = GUICtrlCreateListViewItem("0|Blue", $ListView2_Auras) $ListView2_aura_2 = GUICtrlCreateListViewItem("1|Violet", $ListView2_Auras) $ListView2_aura_3 = GUICtrlCreateListViewItem("2|Purple", $ListView2_Auras) $ListView2_aura_4 = GUICtrlCreateListViewItem("3|Pink", $ListView2_Auras) $ListView2_aura_5 = GUICtrlCreateListViewItem("4|Red", $ListView2_Auras) $ListView2_aura_6 = GUICtrlCreateListViewItem("5|Yellow", $ListView2_Auras) $ListView2_aura_7 = GUICtrlCreateListViewItem("A|Green", $ListView2_Auras) $ListView2_aura_8 = GUICtrlCreateListViewItem("F|white", $ListView2_Auras) $ListView2_aura_9 = GUICtrlCreateListViewItem("C|Empty", $ListView2_Auras) $hListview_Auras = GUICtrlGetHandle($ListView2_Auras) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### GUIRegisterMsg($WM_NOTIFY, 'WM_NOTIFY') While True Switch GUIGetMsg() Case $ListView1_CAC_1 $bone_id = 777 Case $GUI_EVENT_CLOSE, $Start_Convert Exit EndSwitch WEnd Func WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $wParam Local $tNMHDR = DllStructCreate($tagNMHDR, $lParam) Local $hWndFrom = HWnd($tNMHDR.hWndFrom) Local $aData Switch $tNMHDR.Code Case $NM_CLICK Switch $hWndFrom Case $hListview_Bon $aData = StringSplit(GUICtrlRead(GUICtrlRead($ListView1_Bon)), '|') If IsArray($aData) Then GUICtrlSetData($RE_cac_ID, $aData[0] > 1 ? $aData[1] : '') Case $hListview_Auras $aData = StringSplit(GUICtrlRead(GUICtrlRead($ListView2_Auras)), '|') If IsArray($aData) Then GUICtrlSetData($RE_aura_ID, $aData[0] > 1 ? $aData[1] : '') EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc Edited November 29, 2023 by Andreik ERIC_DEUCHER 1 When the words fail... music speaks. Link to comment Share on other sites More sharing options...
ERIC_DEUCHER Posted November 29, 2023 Author Share Posted November 29, 2023 GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 40) ; <<< ----- what do you think it happens here? Yes, I have no idea what -1 means. Link to comment Share on other sites More sharing options...
Andreik Posted November 29, 2023 Share Posted November 29, 2023 If you pass -1 it is like you would pass the ID of the last created control. In the example above it doesn't make any sense. $RE_aura_ID = GUICtrlCreateInput("", 16, 312, 105, 24) ; <<< --- this is the last created control GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") ;ListView GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 40) ; <<< --- LVM_SETCOLUMNWIDTH is sent to $RE_aura_ID which doesn't make any sense In my opinion it's better to pass the exact control ID so there is no confusion and to avoid possible issues if another control it's created meanwhile. ERIC_DEUCHER 1 When the words fail... music speaks. Link to comment Share on other sites More sharing options...
ERIC_DEUCHER Posted November 29, 2023 Author Share Posted November 29, 2023 The correct approach is to simply remove the -1 from the code, then? Link to comment Share on other sites More sharing options...
Andreik Posted November 29, 2023 Share Posted November 29, 2023 (edited) 16 minutes ago, ERIC_DEUCHER said: The correct approach is to simply remove the -1 from the code, then? Both are correct but using -1 is not as using a specific control ID. In case you later add code to your script, using the last created control ID (-1) might lead to undesired behavior. As you can see in the second example posted (using native functions), if you intend to set these properties to the list view, logically would be to place these just after the creation of the list view. $ListView2_Auras = GUICtrlCreateListView("ID|Name", 144, 208, 154, 214) ; <<< --- this is the last created control ; If a new control is created here, the message and the font are assigned to this new control ; but since there is no control created here the following code is equivalent GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 40) ; <<< --- this is equivalent of GUICtrlSendMsg($ListView2_Auras, $LVM_SETCOLUMNWIDTH, 0, 40) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 60) ; <<< --- this is equivalent of GUICtrlSendMsg($ListView2_Auras, $LVM_SETCOLUMNWIDTH, 1, 60) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") ; <<< --- this is equivalent of GUICtrlSetFont(ListView2_Auras, 10, 400, 0, "MS Sans Serif") The safer way it's to set the intended control ID like below: $ListView2_Auras = GUICtrlCreateListView("ID|Name", 144, 208, 154, 214) ... ; If here is some more code, even if a new control is created ; the messages below and the font will apply to $ListView2_Auras ... GUICtrlSendMsg($ListView2_Auras, $LVM_SETCOLUMNWIDTH, 0, 40) GUICtrlSendMsg($ListView2_Auras, $LVM_SETCOLUMNWIDTH, 1, 60) GUICtrlSetFont($ListView2_Auras, 10, 400, 0, "MS Sans Serif") Edited November 29, 2023 by Andreik ERIC_DEUCHER 1 When the words fail... music speaks. Link to comment Share on other sites More sharing options...
ERIC_DEUCHER Posted November 29, 2023 Author Share Posted November 29, 2023 I applied the changes you mentioned, but tell me, is using a function really the only way to modify the values in the interface? Link to comment Share on other sites More sharing options...
Andreik Posted November 29, 2023 Share Posted November 29, 2023 Not sure what do you mean by using a function. When the words fail... music speaks. Link to comment Share on other sites More sharing options...
ERIC_DEUCHER Posted November 29, 2023 Author Share Posted November 29, 2023 The first code you made for me: GUIRegisterMsg($WM_NOTIFY, 'WM_NOTIFY') Func WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam) I'm trying to find another way for the value to be changed in the input because I haven't been able to understand your 'func' yet. Link to comment Share on other sites More sharing options...
Andreik Posted November 29, 2023 Share Posted November 29, 2023 Of course you can do something like this but it's not as good as the code above: #include <ListViewConstants.au3> #include <GUIConstants.au3> Global $cLastSelection = Null, $cCurrentSelection, $aRead $hMain = GUICreate('Example', 400, 400) $cListview = GUICtrlCreateListView('ID|Name', 10, 10, 380, 300) $cInput = GUICtrlCreateInput('', 10, 350, 150, 30) GUICtrlCreateListViewItem("64|Human Male", $cListview) GUICtrlCreateListViewItem("65|Human Female", $cListview) GUICtrlCreateListViewItem("66|Saiyan Male", $cListview) GUICtrlCreateListViewItem("67|Saiyan Female", $cListview) GUICtrlCreateListViewItem("68|Namekian", $cListview) GUICtrlCreateListViewItem("69|Frieza Race", $cListview) GUICtrlCreateListViewItem("6a|Majin Male", $cListview) GUICtrlCreateListViewItem("6b|Majin Female", $cListview) GUICtrlSendMsg($cListview, $LVM_SETCOLUMNWIDTH, 0, 40) GUICtrlSendMsg($cListview, $LVM_SETCOLUMNWIDTH, 1, 100) GUISetState(@SW_SHOW, $hMain) While True If GUIGetMsg() = $GUI_EVENT_CLOSE Then Exit $cCurrentSelection = GUICtrlRead($cListview) If $cCurrentSelection <> $cLastSelection Then $cLastSelection = $cCurrentSelection $aRead = StringSplit(GUICtrlRead($cCurrentSelection), '|') If IsArray($aRead) Then GUICtrlSetData($cInput, $aRead[0] > 1 ? $aRead[1] : '') EndIf WEnd ERIC_DEUCHER 1 When the words fail... music speaks. Link to comment Share on other sites More sharing options...
ERIC_DEUCHER Posted November 29, 2023 Author Share Posted November 29, 2023 Haha, I understand this one. Maybe someday I'll reach your level of understanding, but currently, I'm garbage, hahaha. Link to comment Share on other sites More sharing options...
ERIC_DEUCHER Posted November 29, 2023 Author Share Posted November 29, 2023 I made some adaptations to the code, and it's working on all my ListViews. Thank you very much for helping me, Andreik. Link to comment Share on other sites More sharing options...
Andreik Posted November 29, 2023 Share Posted November 29, 2023 As long you are happy with the result and the job it's done, everything else are just details. ERIC_DEUCHER 1 When the words fail... music speaks. Link to comment Share on other sites More sharing options...
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