文章收藏-FAQ 位置:电脑学习网

用 VB 实现超级链接功能

声明 ShellExecute 函数;在 form 上建立 label、line 控件各一个(myHttp、Line1),再仿照以下代码,即可打开浏览器登录 http://www.why100000.com 网站。
     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 myHttp_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
       Line1.Visible = False
     End Sub
     Private Sub myHttp_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
       Line1.Visible = True
     End Sub
     Private Sub Form_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
       Line1.Visible = False
     End Sub
     Private Sub myHttp_Click()
       Dim HttpJump
       Dim MyUrl As String
       MyUrl = “http://www.why100000.com”
       HttpJump = ShellExecute(0&, vbNullString, MyUrl, vbNullString, vbNullString, vbNormalFocus)
     End Sub

     [文章来源:“十万个为什么”电脑学习网]
     [网络地址:http://why100000.com]
     [版权声明:除本站部分特别声明禁止转载的专稿外,其他的文章可以自由转载,但请务必注明出处和原始作者。本站文章版权归文章原作者所有。如果本站转载的文章有版权问题请联系本站,我们会尽快予以更正。]
 

【字体:[大] [中] [小] 【加入收藏】 【发表评论】 【关闭本窗口】

Copyright © “十万个为什么”电脑学习网 2000-2007 陕ICP备06007929号
站务联系:MSN & Email:zhangking2008@gmail.com  QQ:9365822