Private Sub Text11_Change() Dim oldtext As String c = Text1.SelStart oldtext = Text1.Text a = Replace(oldtext, "/", "", 1, , vbTextCompare) b = Len(a) Text1.Text = Left(a, 4) + "/" + Mid(a, 5, 2) + "/" + Mid(a, 7, 2) If b < 4 Then Text1.SelStart = c Else If b >= 4 And b <= 6 Then Text1.SelStart = c + 1 Else If b < 6 Then Text1.SelStart = c + 2 End If End If
End Sub
maskedit是什么? dtp日期控件又是什么? 请详细回答,
dtp是dtpicket 是一个日期控件,可以自定义显示格式
dtpicket在Miscrosoft Windows common Controls-2 6.0中
Dim oldtext As String
c = Text1.SelStart
oldtext = Text1.Text
a = Replace(oldtext, "/", "", 1, , vbTextCompare)
b = Len(a)
Text1.Text = Left(a, 4) + "/" + Mid(a, 5, 2) + "/" + Mid(a, 7, 2)
If b < 4 Then
Text1.SelStart = c
Else
If b >= 4 And b <= 6 Then
Text1.SelStart = c + 1
Else
If b < 6 Then Text1.SelStart = c + 2
End If
End If
End Sub
dtp日期控件又是什么?
请详细回答,
是一个日期控件,可以自定义显示格式