Function GBBIG5(sStr As String) As String Dim STR If CheckBIG(sStr) Then STR = StrConv(sStr, vbFromUnicode, &H804) GBBIG5 = StrConv(STR, vbUnicode, &H404) Else STR = StrConv(sStr, vbFromUnicode, &H404) GBBIG5 = StrConv(STR, vbUnicode, &H804) End If End Function给分吧!!!
找不到CheckBIG这个函数啊??
我是这样调用的: Private Sub Command1_Click() Dim aa As String aa = Trim(Me.Text1.Text) Me.Text2.Text = GBBIG5(aa) End Sub
Function Limit_Only(ByVal x As Integer) As Integer Select Case x Case 8, 9, Asc("0") To Asc("9") '允许Tab,BackSpace和数字键 Limit_Only = x Case Asc("A") To Asc("Z") '允许大写字符 Limit_Only = x Case Asc("a") To Asc("z") '允许小写字符 Limit_Only = x Case Else Dim Value As Long Value = (CLng(65536) + x) Mod 65536 If (CByte(Value \ 256) And &HA0) And (CByte(Value Mod 256) And &HA0) Then Limit_Only = x Else Limit_Only = 0 End If End Select End Functionhttp://expert.csdn.net/Expert/topic/1554/1554027.xml?temp=.4562189
Dim STR
If CheckBIG(sStr) Then
STR = StrConv(sStr, vbFromUnicode, &H804)
GBBIG5 = StrConv(STR, vbUnicode, &H404)
Else
STR = StrConv(sStr, vbFromUnicode, &H404)
GBBIG5 = StrConv(STR, vbUnicode, &H804)
End If
End Function给分吧!!!
Private Sub Command1_Click()
Dim aa As String
aa = Trim(Me.Text1.Text)
Me.Text2.Text = GBBIG5(aa)
End Sub
Select Case x
Case 8, 9, Asc("0") To Asc("9") '允许Tab,BackSpace和数字键
Limit_Only = x
Case Asc("A") To Asc("Z") '允许大写字符
Limit_Only = x
Case Asc("a") To Asc("z") '允许小写字符
Limit_Only = x
Case Else
Dim Value As Long
Value = (CLng(65536) + x) Mod 65536
If (CByte(Value \ 256) And &HA0) And (CByte(Value Mod 256) And &HA0) Then
Limit_Only = x
Else
Limit_Only = 0
End If
End Select
End Functionhttp://expert.csdn.net/Expert/topic/1554/1554027.xml?temp=.4562189