论坛: 编程破解 标题: 这段VB代码哪里出错啦? 复制本贴地址    
作者: thirdworld [thirdworld]    论坛用户   登录
需要在FORM窗体中创建一个text控件先。
Private Sub Form_Click()
Dim a As String
a = InputBox("查找")
Dim b As Integer
b = InStr(Text1.Text, a)
If b >= o Then
Text1.SelStart = b - 1
Text1.SelLength = Len(a)
Else
MsgBox "don't find it"

End If
End Sub

Private Sub Form_Load()
Text1.Text = "abcdefghijklmnopqrstuvwxyz"
End Sub

--------------------------------------
当输入text1中存在的字母时,运行正常,可是当查找内容不在text1中里,它提示“实时错误380”无效属性值。

该怎么改?

地主 发表时间: 04-09-26 10:50

回复: minc11 [minc11]   论坛用户   登录
把 if b>=0 改为 if b>0

B1层 发表时间: 04-09-26 15:09

回复: thirdworld [thirdworld]   论坛用户   登录
楼上的大哥。谢谢你。

B2层 发表时间: 04-09-26 15:29

论坛: 编程破解

20CN网络安全小组版权所有
Copyright © 2000-2010 20CN Security Group. All Rights Reserved.
论坛程序编写:NetDemon

粤ICP备05087286号