If Len(Trim$(txtBdno.Text)) = 4 Then
If IsNumeric(txtBdno.Text) = True Then
txtBdno.Text = txtBdno.Text & "年" Else
txtBdno.SetFocus
txtBdno.SelStart = 0
txtBdno.SelLength = Len(Trim$(txtBdno.Text))
strMes = "请输入数字!"
MsgBox strMes, , "提示!"
End If
End If
我想在输入四个数字后自动添加一个"年"
就是我输入 2001后自动变成 2001年 并将光标放到字符串后面继续输入?
即 2001年 后面
该怎么办?
If IsNumeric(txtBdno.Text) = True Then
txtBdno.Text = txtBdno.Text & "年" Else
txtBdno.SetFocus
txtBdno.SelStart = 0
txtBdno.SelLength = Len(Trim$(txtBdno.Text))
strMes = "请输入数字!"
MsgBox strMes, , "提示!"
End If
End If
我想在输入四个数字后自动添加一个"年"
就是我输入 2001后自动变成 2001年 并将光标放到字符串后面继续输入?
即 2001年 后面
该怎么办?
解决方案 »
- InternetGetCookie 怎么用?
- VB 调用系统计算器
- 请问VB高手ReDim SJARR(1 To N)是什么意思
- 请教
- 请教一个参数化查询的问题
- 如何只加载很大的图片的一部分显示在PictureBox中?
- 在窗体里画图,提示方法和成员未找到 Addline是选黑的!!!
- vb6.0设计添加收藏夹功能,输入以下代码没有反应!!!
- 关于ToolHelp
- VB中dtpicker日期控件中怎么用法啊?……
- VB+SQL SERVER 与双操作系统的问题 ............在线..........
- 如何实现把一个(或多个)目录(包含子目录)下的所有pdf格式的文件转成txt(或doc,rtf)文件?
sendkeys "{End}"
txtBdno.SelStart = Len(Text1.Text)
Option ExplicitDim i As String
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
If Len(Trim$(Text1.Text)) = 4 Then
If IsNumeric(Text1.Text) = True Then
i = i + Text1.Text & "年"
Print i
Else
Text1.Text = ""
Text1.SetFocus
End If
End If
End If
End Sub