Page 1 of 1

How to get gui edit box value from a drap and drop ui

Posted: 31 Dec 2019, 17:47
by takayo97
Here is a sample code of demonstrate drag and drop edit box ui. The code I was found somewhere in the forum

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
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

Re: How to get gui edit box value from a drap and drop ui

Posted: 31 Dec 2019, 18:37
by flyingDman
either:

Code: Select all

ControlGetText,MyEdit,Edit1,A
msgbox % MyEdit
or

Code: Select all

gui, submit, nohide
msgbox % MyEdit

Re: How to get gui edit box value from a drap and drop ui

Posted: 31 Dec 2019, 23:16
by takayo97
thx