#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
$Form1 = GUICreate("Form1", 155, 150, 192, 114)
$Input1 = GUICtrlCreateInput("", 8, 24, 121, 21)
$Input2 = GUICtrlCreateInput("", 8, 64, 121, 21)
$Input3 = GUICtrlCreateInput("", 8, 96, 121, 21)
GUIRegisterMsg($WM_COMMAND, "_WM_COMMAND")
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
Func _WM_COMMAND($hWnd, $iMsg, $wParam, $lParam)
Switch BitAND($wParam, 0xFFFF)
Case $Input1,$Input2,$Input3
Switch BitShift($wParam, 16)
Case $EN_CHANGE
; Сначала должен быть указан знак + или -
If StringLeft(GUICtrlRead($Input1),1)<>'+' And StringLeft(GUICtrlRead($Input1),1)<>'-' Then GUICtrlSetData($Input1, '')
If StringLeft(GUICtrlRead($Input2),1)<>'+' And StringLeft(GUICtrlRead($Input2),1)<>'-' Then GUICtrlSetData($Input2, '')
If StringLeft(GUICtrlRead($Input3),1)<>'+' And StringLeft(GUICtrlRead($Input3),1)<>'-' Then GUICtrlSetData($Input3, '')
GUICtrlSetData($Input1, StringRegExpReplace(GUICtrlRead($Input1), "[^\d+-]|(?<!\A)[+-]", ""))
GUICtrlSetData($Input2, StringRegExpReplace(GUICtrlRead($Input2), "[^\d+-]|(?<!\A)[+-]", ""))
GUICtrlSetData($Input3, StringRegExpReplace(GUICtrlRead($Input3), "[^\d+-]|(?<!\A)[+-]", ""))
EndSwitch
EndSwitch
Return $GUI_RUNDEFMSG
EndFunc