熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> .NET編程 >> 正文

在vb中實現超連接的方法!和直接發郵件

2013-11-13 10:09:24  來源: .NET編程 

  新建立一個模塊
然後再其中添加如下代碼
Option Explicit

  Public Const email =
Public Const URL =
Public Declare Function ShellExecute Lib shelldll 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 =
Public Sub gotoweb()
Dim Success As Long

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

  End Sub
Public Sub sendemail()
Dim Success As Long

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

  End Sub
接著就簡單不過了!
在你所要進行超連接的窗體中如實現LABEL的超連接
那就在LABEL的CLICK事件中加入  gotoweb或sendemail 即可!


From:http://tw.wingwit.com/Article/program/net/201311/12732.html
    推薦文章
    Copyright © 2005-2013 電腦知識網 Computer Knowledge   All rights reserved.