;=============================================================================== ; Function Name: _GuiCtrlEdit_BlockChars() ; Description: Blocks chars that are given as a parameter ; Parameter(s): $aID = The Controll-ID of the Edit/Input ; $aChars = An array containing all chars to be blocked ; Requirement(s): None ; Return Value(s): On Success - None ; On Failure - 0 and @error = 1 ; Author(s): Daniel Wahlmann ( Daniel W. ) - danielwahlmann@web.de ; Note(s): ;=============================================================================== Func _GuiCtrlEdit_BlockChars( $aID, $aChars ) If ( IsArray( $aChars ) == False ) Then Return ( SetError( 1, 1, 0 ) ) Local $lNum For $lNum = 1 to $aChars[0] $lRead = GUICtrlRead( $aID ) If ( StringInStr( $lRead, $aChars[$lNum] ) > 0 ) Then GUICtrlSetData( $aID, StringReplace( $lRead , $aChars[$lNum], "" ) ) EndIf Next Sleep( 10 ) EndFunc ;############### ;### Example ### ;############### Opt( "GuiOnEventMode", 1 ) Dim $gChars = StringSplit( "a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z", "|") GUICreate( "_GuiCtrlEdit_BlockChars( $aID, $aChars ) Example" ) $ctrlEdit = GUICtrlCreateEdit( "abcdefghijklmnopqrstuvwxyz", 10, 10, 200, 60 ) GUISetOnEvent( -3, "_Exit" ) GUISetState() While 1 _GuiCtrlEdit_BlockChars( $ctrlEdit, $gChars ) WEnd Func _Exit() Exit EndFunc