问题描述:
解析:
给你个例子:
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Private Sub Form_Load()
Label1.Caption = "hi.baidu/sxtiger"
End Sub
Private Sub Label1_Click()
Call ShellExecute(Form1.hwnd, "open", Label1.Caption, vbNullString, vbNullString, &H0)
End Sub
DimNum
As
Long
Private
Sub
Command1_Click()
WebBrowser1.Navigate
"www.google.cn/custom?q=%D7%B0%CA%CE&sa=Google+%CB%D1%CB%F7&client=pub-4986028629684026&forid=1&ie=GB2312&oe=GB2312&cof=GALT%3A%23008000%3BGL%3A1%3BDIV%3A%23336699%3BVLC%3A663399%3BAH%3Acenter%3BBGC%3AFFFFFF%3BLBGC%3A336699%3BALC%3A0000FF%3BLC%3A0000FF%3BT%3A000000%3BGFNT%3A0000FF%3BGIMP%3A0000FF%3BFORID%3A1&hl=zh-CN"
Num
=
Num
+
1
End
Sub
Private
Sub
Command2_Click()
If
Num
=
3
Then
MsgBox
"ok!!",
vbInformation
End
If
End
Sub
Private
Sub
Form_Load()
Num
=
0
End
Sub
再贴代码前请先在"工程"-->设定元件--->选择Microsoft
internet
controls(把前面的空格勾上)
然后套用
在form1
上
加入一个
控件
用来打开网页的!!
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)