如何在VB编写的软件上加上超链接?

如何在VB编写的软件上加上超链接?,第1张

分类: 电脑/网络 >>程序设计 >>其他编程语言

问题描述:

如何在用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


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/bake/11424943.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-16
下一篇 2023-05-16

发表评论

登录后才能评论

评论列表(0条)

保存