| 订阅 | 在线投稿
分享
 
 
 

在vb中实现超连接的方法!和直接发邮件!

来源:互联网网民  宽屏版  评论
2007-02-01 20:10:56

新建立一个模块

然后再其中添加如下代码 :

Option Explicit

Public Const email = "support@online.com"

Public Const URL = "http://blog.csdn.net/flm2003/"

Public 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

Public Const SW_SHOWNORMAL = 1

Public Sub gotoweb()

Dim Success As Long

Success = ShellExecute(0&, vbNullString, URL, vbNullString, "C:\", SW_SHOWNORMAL)

End Sub

Public Sub sendemail()

Dim Success As Long

Success = ShellExecute(0&, vbNullString, "mailto:" & email, vbNullString, "C:\", SW_SHOWNORMAL)

End Sub

接着就简单不过了!

在你所要进行超连接的窗体中,如实现LABEL的超连接

那就在LABEL的CLICK事件中加入 gotoweb或sendemail 即可!

 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
新建立一个模块 然后再其中添加如下代码 : Option Explicit Public Const email = "[url=mailto:support@online.com]support@online.com[/url]" Public Const URL = "[url=http://blog.csdn.net/flm2003/]http://blog.csdn.net/flm2003/[/url]" Public 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 Public Const SW_SHOWNORMAL = 1 Public Sub gotoweb() Dim Success As Long Success = ShellExecute(0&, vbNullString, URL, vbNullString, "C:\", SW_SHOWNORMAL) End Sub Public Sub sendemail() Dim Success As Long Success = ShellExecute(0&, vbNullString, "mailto:" & email, vbNullString, "C:\", SW_SHOWNORMAL) End Sub 接着就简单不过了! 在你所要进行超连接的窗体中,如实现LABEL的超连接 那就在LABEL的CLICK事件中加入 gotoweb或sendemail 即可!
󰈣󰈤
 
 
 
>>返回首页<<
 
 热帖排行
 
 
静静地坐在废墟上,四周的荒凉一望无际,忽然觉得,凄凉也很美
©2005- 王朝网络 版权所有