When I named the button lowercase "ftp", I encountered a strange phenomenon.
When I click on it, the ftp address in the clipboard is written to Edit box. Zooming the window at this point, the buttons and the edit box cannot move and scale as expected.
But when there is no ftp address in the clipboard or the button name is changed to other or uppercase "FTP" or "Ftp", everything is displayed normally.
Why is this happening? Is ftp a reserved variable name?
Thanks.
Code: Select all
Gui, +Resize
Gui, Add, Edit, h100 w300 vEdit1, This is a test.
Gui, Add, Button,, ftp
Gui, Show
return
GuiSize:
GuiControl, Move, Edit1, % "w" A_GuiWidth -10 "h" A_GuiHeight -40
GuiControl, Move, ftp, % "y" A_GuiHeight -30
return
GuiClose:
ExitApp
; Extract the ftp address in the clipboard and write it to the edit box
Buttonftp:
FoundPos := 1
while FoundPos := RegExMatch(Clipboard, "i)ftp://[0-9A-Z-\._~%!\$&'\(\)\*\+,;=:]{3,}((/[0-9A-Z-\._~%!\$&'\(\)\*\+,;=:@]*)*(/[0-9A-Z-\._~%!\$&'\(\)\*\+,;=:@]+))?(?<![\.'\(\),;])", URL, FoundPos + StrLen(URL))
r .= URL . "`r`n"
GuiControl, Text, Edit1, %r%
return