Цитата san45:
надо чтобы при вводе текста в Input/edit введенный текст отображался в заданном формате »
|
Код:
#include <GuiConstantsEx.au3>
#include <WindowsConstants.au3>
#include <EditConstants.au3>
#include <String.au3>
GUICreate("Input Changed Demo GUI", 300, 140)
$Input_1 = GUICtrlCreateInput("Input 1", 20, 20, 260, 20)
$Exit = GUICtrlCreateButton("Exit", 20, 110, 60, 20)
GUISetState()
GUIRegisterMsg($WM_COMMAND, "WM_COMMAND")
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE, $Exit
ExitLoop
EndSwitch
WEnd
Func WM_COMMAND($hWnd, $msg, $wParam, $lParam)
Local $nNotifyCode = BitShift($wParam, 16)
Local $nID = BitAND($wParam, 0xFFFF)
Local $hCtrl = $lParam
Switch $nID
Case $Input_1
Switch $nNotifyCode
Case $EN_CHANGE, $EN_UPDATE
Local $sInput_Read = GUICtrlRead($Input_1)
If $sInput_Read == "абв" Then
Local $aChars = StringSplit($sInput_Read, "")
$sInput_Read = ""
For $i = 1 To $aChars[0]
$sInput_Read &= $aChars[$i] & $aChars[$i] & $aChars[$i]
Next
GUICtrlSetData($Input_1, StringUpper($sInput_Read))
ElseIf StringRegExp($sInput_Read, "\d+") Then
GUICtrlSetData($Input_1, _StringAddThousandsSep($sInput_Read))
EndIf
EndSwitch
EndSwitch
Return $GUI_RUNDEFMSG
EndFunc