| 導購 | 订阅 | 在线投稿
分享
 
 
 

在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 即可!
󰈣󰈤
 
 
 
>>返回首頁<<
 
 
 
 
 熱帖排行
 
王朝網路微信公眾號
微信掃碼關註本站公眾號 wangchaonetcn
 
  免責聲明:本文僅代表作者個人觀點,與王朝網絡無關。王朝網絡登載此文出於傳遞更多信息之目的,並不意味著贊同其觀點或證實其描述,其原創性以及文中陳述文字和內容未經本站證實,對本文以及其中全部或者部分內容、文字的真實性、完整性、及時性本站不作任何保證或承諾,請讀者僅作參考,並請自行核實相關內容。
 
© 2005- 王朝網路 版權所有