Editbox: limit 1st char input to start with alphabet only Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
ivill
Posts: 124
Joined: 13 May 2016, 02:23

Editbox: limit 1st char input to start with alphabet only

27 Sep 2017, 02:10

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
Helgef
Posts: 4709
Joined: 17 Jul 2016, 01:02
Contact:

Re: Editbox: limit 1st char input to start with alphabet only  Topic is solved

27 Sep 2017, 02:29

Hello,

Code: Select all

gui, add, edit, w300 gedit vedit
gui show
return 
edit:
	gui, submit, nohide
	if !(edit ~= "^[a-zA-Z]")
		guicontrol,, edit
return
Unfortunately, it seems to fail if you type, eg, two numbers very quick. :? Maybe it can get you in the right direction. Cheers.
Last edited by Helgef on 27 Sep 2017, 03:02, edited 1 time in total.
User avatar
ivill
Posts: 124
Joined: 13 May 2016, 02:23

Re: Editbox: limit 1st char input to start with alphabet only

27 Sep 2017, 02:46

Helgef wrote:Hello,

Code: Select all

gui, add, edit, w300 gedit vedit
gui show
return 
edit:
	gui, submit, nohide
	if !(edit ~= "^[a-zA-Z]")
		guicontrol,, edit
return
Unfortunately, it seems to fail if you type, eg, two numbers very quick. :? May it can get you in the right direction. Cheers.
Thanks! @Helgef if !(edit ~= "^[a-zA-Z]") even shorter but useful than expected

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot], Mateusz53, MrDoge, peter_ahk and 355 guests