在线等,急需一个VB小程序,清除冒号右方的第一个数字

2024-12-17 03:02:40
推荐回答(1个)
回答1:

Private Sub Command1_Click()
Dim i As Long
Dim s As String
Dim r As String
Dim F As Boolean
For i = 1 To Len(Text1.Text)
s = Mid(Text1.Text, i, 1)
If s = ":" Then
F = True
End If
If Not (F = True And IsNumeric(s) = True) Then
r = r & s
Else
F = False
End If
Next i
Text1.Text = r
End Sub
'记得textbox的multiline属性是true,添加一个按钮即可