问题描述:
如何在用VB编写的软件上加上超链接?让别人可以访问我的网站
解析:
给你个例子:
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
用一个LABEL框,把label框的autosize改为TURE,backstyle改为0,forecolor改为蓝色,字体加下划线然后用下面的代码就OK了
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
Label1_Click()
Dim
HttpJump
Dim
MyUrl
As
String
MyUrl
=
"
http://wenwen.soso.com
"
HttpJump
=
ShellExecute(0&,
vbNullString,
MyUrl,
vbNullString,
vbNullString,
vbNormalFocus)
End
Sub
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)