Private Sub Text1_Lostfocus() Dim k%,n% n=Len(______) For k=1 to IIf(n>3,n,4) c=Mid(Text1.Text,k,1) Select Case k Case 1,2 If c<"A" Or c>"Z" Then MsgBox("第"&k&"个字符必须是大写字母!") SetPosition k Exit For End If Case 3 If c<>"-" Then MsgBox("第"&k&"个字符必须是字符"’"-"’") SetPosition k Exit For End If Case Else If c<"0" Or c>"9" Then MsgBox("第"&k&"个字符必须是数字!") SetPosition k Exit For End If End Select Next k End Sub Private Sub SetPosition(pos As Integer) Text1.SetStart=pos-1 Text.SelLength=______ Text1.______ End Sub