How to get gui edit box value from a drap and drop ui
Posted: 31 Dec 2019, 17:47
Here is a sample code of demonstrate drag and drop edit box ui. The code I was found somewhere in the forum
I tried to display the MyEdit value before existing the app. The value was shown just blank even i was dragged a file in the field
Code: Select all
Gui, Add, Edit, x5 y108 w358 h24 vMyEdit,
Gui, Add, Button, x68 y137 w54 h24 , OK
Gui, Add, Button, x247 y137 w54 h24 , Cancel
Gui, Add, Text, x5 y5 w358 h98 , What is your file name?
; Generated using SmartGUI Creator 4.0
Gui, Show, x652 y408 h168 w370, GuiTitle
Return
GuiClose:
msgbox % MyEdit
ExitApp
GuiDropFiles:
GuiControl,, MyEdit, %A_GuiEvent% ;This will only work properly if one file is dropped on the GUI. To handle several files being dropped, see help file on GuiDropFiles.
return