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

Dim

Num

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

加入一个

控件

用来打开网页的!!


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

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

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

发表评论

登录后才能评论

评论列表(0条)

保存