VB打开 TEXT中的网页

来源:百度知道 编辑:UC知道 时间:2024/06/26 00:55:58
这个不是一般得打开

比如 Text 中 输入的 是 123
然后 ,自动打开 代码区 设定的 网战+文件

比如 TEXT中输入的 是 123
然后
WebBrowser1 控件 打开的 是
www.baidu.com/123

然后 TEXT必须 输入的是 小于52 的数字!~ 不能输入别的~

你要的程序做好了,自己写的!!!

现把代码呈上:
Private Sub Command1_Click()
Dim strURL
strURL = "http://www.baidu.com/" & Text1.Text
MsgBox strURL
Shell "explorer.exe " & strURL, 1
End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)
If Len(Text1.Text) = 0 Then
If (Chr(KeyAscii) Like "[!0-5]") Then
Beep
KeyAscii = 0
End If
ElseIf Len(Text1.Text) = 1 Then
If Val(Text1.Text) < 5 Then
If (Chr(KeyAscii) Like "[!0-9]") Then
Beep
KeyAscii = 0
End If
Else
If (Chr(KeyAscii) Like "[!0-2]") Then
Beep
KeyAscii = 0
End If
End If
Else
Beep
KeyAscii = 0
End If
End Sub

相互学习才会进步!!!

Private Sub Form_click()
If 0 <= Val(