19/05/2023: A causa di un errore sono stati cancellati, insieme ad account creati da bot, alcuni account legittimi. Si prega di leggere qui: https://www.gambas-it.org/smf/index.php?topic=9733.0
PUBLIC SUB TextBox1_change() DIM n AS Integer DIM char, newtext AS String FOR n = 1 TO Len(LAST.text) char = Mid$(LAST.text, n, 1) IF char LIKE "[0-9]" THEN newtext = newtext & Mid$(LAST.text, n, 1) ENDIF NEXT LAST.text = newtext END
PUBLIC SUB TextBox1_KeyPress() SELECT Key.code CASE Key.Enter, Key.BackSpace, Key.Delete, Key.Left, Key.Right, Key.Return, Key.space RETURN END SELECT IF Key.Text LIKE "[0-9]" THEN RETURN ELSE STOP EVENT ENDIF END