visual basic(20)

2008-02-20 1:40 am
1)how to make a linklabel or a linkcommandbutton(just like --> when i clicked it , open http://www.yahoo.com.hk)
thxthxthxthxthxthx
vb 6

回答 (2)

2008-02-20 10:27 am
✔ 最佳答案
可以用KE LinkLabel ActiveX
下載:
http://www.norexe.com/programs/kell.zip
用法:
現解壓縮出ocx檔案,然後在VB6.0主視窗下:
1.按下Ctrl+T
2.在第一個Tab按下瀏覽(B)
3.選擇剛才解壓縮後的ocx檔案
4.確定
5.回到表單設計視窗,您會發現多了個Control
6.使用這個Label即可達到要求(可以設置MouseOverUnderLine屬性為True以顯示底線)
2008-02-23 6:14 pm
利用VB製作超連結的方法有兩種,一是利用VB內建的函數-Shell,一是利用API函數ShellExecute:

Private Sub Command1_Click()
 Shell "Explorer http://www.vbex.net", vbNormalFocus
End Sub

另一個方法:

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 Command1_Click()
 ShellExecute Me.hWnd, vbNullString, "http://www.vbex.net", "", "", vbNormalFocus
End Sub


------------------------
VB範例網
http://www.vbex.net/


收錄日期: 2021-04-20 21:26:57
原文連結 [永久失效]:
https://hk.answers.yahoo.com/question/index?qid=20080219000051KK01897

檢視 Wayback Machine 備份