标题:新手:下面程序我运行时只要输入非十六进制数点击对话框后就会出错
只看楼主
body_gd
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2016-3-22
结帖率:0
已结贴  问题点数:20 回复次数:1 
新手:下面程序我运行时只要输入非十六进制数点击对话框后就会出错
Private Sub Command1_Click()
 Dim x As Integer
 Dim Y As String
 Dim I As Long
 Dim C As Boolean
 Dim text0 As String
 If (Combo1.Text = "十六进制转十进制") Then
    Text1 = UCase(Text1)
    If Len(Text1) <> 0 Then
      For I = 1 To Len(Text1)
         text0 = Mid(Text1, Len(Text1) + 1 - I, 1)
         If C = Not (text0 Like "*[!0-9A-Fa-f]*") Then
            x = MsgBox("请输入十六进制数!", vbOK)
            If x = vbOK Then
               Cancel = -1
            End If
            Text1 = ""
            Text3 = ""
         End If
      Next I
    AA = HEX_to_DEC(Text1)
    Text3 = Val(AA)
    End If
   
   ElseIf (Combo1.Text = "十进制转十六进制") Then
2016-03-22 08:54
luckhide
Rank: 5Rank: 5
来 自:青岛
等 级:职业侠客
帖 子:51
专家分:338
注 册:2016-3-19
得分:20 
         If C = Not (text0 Like "*[!0-9A-Fa-f]*") Then
修改如下试试:
         If Not (text0 Like "*[!0-9A-Fa-f]*") Then
2016-03-22 10:00



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-462764-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.142506 second(s), 7 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved