Hi, all, is it possible to make an EditBox limit first character input to start with alphabet letter only? if not A-Z, then clear the input field.
ABCDEFG ;true
A1BCDEF ;true
1 ;false & clear input field
Editbox: limit 1st char input to start with alphabet only Topic is solved
Re: Editbox: limit 1st char input to start with alphabet only Topic is solved
Hello,
Unfortunately, it seems to fail if you type, eg, two numbers very quick.
Maybe it can get you in the right direction. Cheers.
Code: Select all
gui, add, edit, w300 gedit vedit
gui show
return
edit:
gui, submit, nohide
if !(edit ~= "^[a-zA-Z]")
guicontrol,, edit
return
![Confused :?](./images/smilies/icon_e_confused.gif)
Last edited by Helgef on 27 Sep 2017, 03:02, edited 1 time in total.
Re: Editbox: limit 1st char input to start with alphabet only
Thanks! @Helgef if !(edit ~= "^[a-zA-Z]") even shorter but useful than expectedHelgef wrote:Hello,Unfortunately, it seems to fail if you type, eg, two numbers very quick.Code: Select all
gui, add, edit, w300 gedit vedit gui show return edit: gui, submit, nohide if !(edit ~= "^[a-zA-Z]") guicontrol,, edit return
May it can get you in the right direction. Cheers.