I have another question for you, or anyone here
I am trying to create a GUI and the first task is to create a combo and a text input. In the combo user selects the partition and in the input the folder name.
So my plan is to concatenate the two string in order to create a path so that i can create a folder.
This is my code so far:
; Create a GUI with various controls.
Local $hGUI = GUICreate("Move stuff", 500, 500)
; Create OK button
Local $idOK = GUICtrlCreateButton("OK", 400, 460, 85, 25)
; Create Cancel button
Local $cancel = GUICtrlCreateButton("Cancel", 300, 460, 85, 25)
; The possible partitions we can create/copy to a folder
Global $aArray[2] = ["C:\", "D:\"]
; Put the possible partitions into a list
$sList = ""
For $i = 0 To UBound($aArray) - 1
$sList &= "|" & $aArray[$i]
Next
; Create a label for the combo
Local $idlabelPartition = GUICtrlCreateLabel("Please select the partition you want to create the folder in:", 10, 20)
; Create the combo
Local $hCombo = GUICtrlCreateCombo("", 10, 40, 200, 20)
; put the list elements into the combo
GUICtrlSetData($hCombo, $sList)
; Create a label for the input field
Local $idlabelFolder = GUICtrlCreateLabel("Please write the desired folder name:", 10, 70)
;create a text area where user can input the foldername
Local $idText = GUICtrlCreateInput("", 10, 90, 300, 20)
; Create a button that when pressed will create the folder with the user inputed name and on the selected partition
Local $createFolder = GUICtrlCreateButton("Create Folder", 10, 120, 100, 20)
; Define a variable that contains the path depending on the user selection
Local $userPath = GUICtrlRead($hCombo) & GUICtrlRead($idText) ;<<< problem seems to be here. the GUICtrlRead($hCombo) and ;GUICtrlRead($idText) are strings but $userPath will not be the output of string concatenation
; Display the GUI.
GUISetState(@SW_SHOW, $hGUI)
; Loop until the user exits.
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE, $idOK, $cancel
ExitLoop
Case $createFolder
MsgBox(0, "", "The path to create a folder is: " & $userPath) ;<<< this does not return the concatenation, it returns nothing
EndSwitch
WEnd
So the problem is that $userParh returns nothing.
So please help if you can.
Thx
Florin