46
Programmazione / Re:controllo immissione dato in textbox
« il: 07 Febbraio 2019, 19:49:05 »
Non funziona con me. Non riesco a inserire una virgola, ma posso inserire '.'
123.................... OK
123.................... OK
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
Questa sezione ti permette di visualizzare tutti i post inviati da questo utente. N.B: puoi vedere solo i post relativi alle aree dove hai l'accesso.
Public Sub TextBox1_Change()
Dim sNewText As String
If TextBox1.Text[0] = "," Then
TextBox1.Clear
Else
For iChar As Integer = 0 To Len(TextBox1.Text) - 1
If InStr(TextBox1.Text[0, iChar], ",") Then
If InStr("0123456789", TextBox1.Text[iChar]) Then sNewText &= TextBox1.Text[iChar]
Else
If InStr("0123456789,", TextBox1.Text[iChar]) Then sNewText &= TextBox1.Text[iChar]
End If
Next
TextBox1.Text = sNewText
End If
End
Public Sub TextBox1_Change()
Dim sNewText As String
Dim iChar As Integer
For iChar = 0 To Len(TextBox1.Text) - 1
If InStr(TextBox1.Text[0, iChar], ",") Then
If InStr("0123456789", TextBox1.Text[iChar]) Then sNewText &= TextBox1.Text[iChar]
Else
If InStr("0123456789,", TextBox1.Text[iChar]) Then sNewText &= TextBox1.Text[iChar]
End If
Next
TextBox1.Text = sNewText
End
Public Sub TextBox1_Change()
Dim sNewText As String
Dim iChar As Integer
For iChar = 0 To Len(TextBox1.Text) - 1
If InStr("0123456789.", TextBox1.Text[iChar]) Then sNewText &= TextBox1.Text[iChar]
Next
TextBox1.Text = sNewText
End
Public Sub TextBox1_Change()
Dim sNewText As String
Dim iChar As Integer
For iChar = 0 To Len(TextBox1.Text) - 1
If IsNumber(TextBox1.Text[iChar]) Then sNewText &= TextBox1.Text[iChar]
Next
TextBox1.Text = sNewText
End
Catch 'If the time is invalid then
Print Error.Text
Message("The time is not valid", "OK") 'Say so
AddTime(True) 'Reset the time without adding 48 more times to the ComboBox list!
End
Move User.Home &/ "test file $GivesError more#**.txt" To User.home &/ "testfile.txt"