当前位置:编程学习 > VB >>

vb中 在label1中显示连接到http:www.1111.com代码是?

vb中 在label1中显示连接到http:www.1111.com代码是?
--------------------编程问答-------------------- label1.caption = "连接到 http://www.1111.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 Label1_Click()
ret& = ShellExecute(me.hwnd, "Open", "http://www.1111.com", "", App.Path, 
End Sub
--------------------编程问答-------------------- '方法1:
'用VB内置函数实现
Option Explicit
Private Const IE = "C:\Program Files\Internet Explorer\IEXPLORE.EXE"

Private Sub Label1_Click()
        Call Shell(IE & " http://www.1111.com", vbNormalFocus)
End Sub

'方法2:
'通过调用API函数实现
Option Explicit
Private Const SW_SHOW = 5
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 Label1_Click()
        Call ShellExecute(0, "Open", "http://www.1111.com", vbNullString, vbNullString, SW_SHOW)
End Sub --------------------编程问答--------------------
'方法1: 
'用VB内置函数实现 
Option Explicit 
Private Const IE = "C:\Program Files\Internet Explorer\IEXPLORE.EXE" 

Private Sub Label1_Click() 
        Call Shell(IE & " http://www.1111.com", vbNormalFocus) 
End Sub 

'方法2: 
'通过调用API函数实现 
Option Explicit 
Private Const SW_SHOW = 5 
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 Label1_Click() 
        Call ShellExecute(0, "Open", "http://www.1111.com", vbNullString, vbNullString, SW_SHOW) 
End Sub
--------------------编程问答--------------------
引用 1 楼 sandrer 的回复:
label1.caption = "连接到 http://www.1111.com"

正解。 --------------------编程问答--------------------
引用 5 楼 bestbadgod 的回复:
引用 1 楼 sandrer 的回复:
label1.caption = "连接到 http://www.1111.com"

正解。


--------------------编程问答-------------------- 是不是楼主吧意思表达错了? --------------------编程问答-------------------- 谢谢大家的回答   我知道了~~~~~谢谢 --------------------编程问答-------------------- 我记得有一个专门的控件的……
补充:VB ,  基础类
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,