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 sNewText As StringDim iChar As IntegerFor iChar = 0 To Len(TextBox1.Text) - 1 If IsNumber(TextBox1.Text[iChar]) Then sNewText &= TextBox1.Text[iChar]NextTextBox1.Text = sNewTextEnd
Prova questo: -Codice: [Seleziona]Public Sub TextBox1_Change()Dim sNewText As StringDim iChar As IntegerFor iChar = 0 To Len(TextBox1.Text) - 1 If IsNumber(TextBox1.Text[iChar]) Then sNewText &= TextBox1.Text[iChar]NextTextBox1.Text = sNewTextEnd
,,,121,,34
Public Sub TextBox1_Change()Dim sNewText As StringDim iChar As IntegerFor iChar = 0 To Len(TextBox1.Text) - 1 If InStr("0123456789.", TextBox1.Text[iChar]) Then sNewText &= TextBox1.Text[iChar]NextTextBox1.Text = sNewTextEnd
1234,45
,132,5,312,44,,,
Public Sub TextBox1_Change()Dim sNewText As StringDim iChar As IntegerFor 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 IfNextTextBox1.Text = sNewTextEnd
Public Sub TextBox1_Change() Dim s, sNewText As String Dim iChar As Integer s = TextBox1.Text If s[0] = "," Then TextBox1.Clear Return Endif 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 = sNewTextEnd
Public Sub TextBox1_Change()Dim sNewText As StringIf TextBox1.Text[0] = "," Then TextBox1.ClearElse 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 = sNewTextEnd IfEnd
Public Sub TextBox1_Change() Dim sNewText As String Dim bChar As Boolean If TextBox1.Text[0] = "," Then TextBox1.Clear Else For i As Integer = 0 To Len(TextBox1.Text) - 1 If TextBox1.Text[i] = "," And bChar Then Continue If TextBox1.Text[i] = "," Then bChar = True If IsNumber(TextBox1.Text[i]) Then sNewText &= TextBox1.Text[i] Next End If TextBox1.Text = sNewTextEnd
Private $sDec As StringPublic Sub Form_Open() Print System.Language Select Case System.Language Case "sv_SE.UTF-8" $sDec = ":" Case "en_US.UTF-8", "C" $sDec = "." Case Else $sDec = "," End Select Print $sDecEndPublic Sub TextBox1_Change() Dim sNewText As String Dim bChar As Boolean If TextBox1.Text[0] = $sDec Then TextBox1.Clear Else For i As Integer = 0 To Len(TextBox1.Text) - 1 If TextBox1.Text[i] = $sDec And bChar Then Continue If TextBox1.Text[i] = $sDec Then bChar = True If IsNumber(TextBox1.Text[i]) Then sNewText &= TextBox1.Text[i] Next End If TextBox1.Text = sNewTextEnd
Public Function Numeri() If Key.Code >= 48 And Key.Code <= 57 Then Else If key.Code = key.BackSpace Then Else If key.Code = key.Delete Then Else If Key.Code = Key.Left Then Else If Key.code = Key.Right Then Else If Key.Code = Key.Tab Then Else Stop Event End If End Public Function Lettere() If Key.code >= 64 And Key.Code <= 90 Then Else If key.Code = key.BackSpace Then Else If key.Code = key.Up Then Else If Key.code = Key.Down Then Else Stop Event Endif End
Public Sub TextBox_Change()If TextBox.text > "" ThenTextBox.text = Format(Replace(TextBox.Text, ",", Null) / 100, "0.00") virgola in automatico inserimento euroEndif End