首页
社区
课程
招聘
VB中如何用按钮打开网址?
2004-5-4 13:56 8663

VB中如何用按钮打开网址?

2004-5-4 13:56
8663
收藏
免费 6
打赏
分享
最新回复 (5)
雪    币: 3246
活跃值: (339)
能力值: (RANK:20 )
在线值:
发帖
回帖
粉丝
blowfish 2004-5-4 13:59
2
0
都可以用ShellExecute( )
雪    币: 213
活跃值: (40)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
StuntGP 2004-5-4 14:01
3
0
:p
雪    币: 200
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
n0n1inear 2004-5-4 15:33
4
0
依BlowFish的思路,可以如下
Dim test As New Shell
test.shellexecute ("http://www.google.com")
同时菜单Project->References下要选择“Microsoft Shell Controls and Automation”,即\windows\system32\shell32.dll。
雪    币: 231
活跃值: (409)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
cobra1111 2004-5-4 17:56
5
0
最初由 n0n1inear 发布
依BlowFish的思路,可以如下
Dim test As New Shell
test.shellexecute ("http://www.google.com")
同时菜单Project->References下要选择“Microsoft Shell Controls and Automation”,即\windows\system32\shell32.dll。


好象不要那么复杂在吧,呵呵,直接shell就行了吧。。。。
错了别打我。。。
雪    币: 205
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
kaokao 2004-5-4 19:19
6
0
方法一:
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 OK_Click()
ShellExecute(0&, vbNullString, "http://bbs.pediy.com", vbNullString, vbNullString, vbNormalFocus)
End Sub

方法二:
Private Sub OK_Click()
Set ie = New InternetExplorer
ie.Visible = True
ie.Navigate "http://bbs.pediy.com"
End Sub


看你喜欢哪种了,我比较喜欢第一个,呵呵
游客
登录 | 注册 方可回帖
返回