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

vb listview如何单击(双击)打开选中行呢

比如 listview的内容是以下三行
http://www.baidu.com
http://www.56.com
http://www.hao123.com

如何单击打开选中的行呢?也就是我点http://www.baidu.com
就打开百度这个网站 ItemClick 事件
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 ListView1_DblClick()
ret& = ShellExecute(PropertyPage.hwnd, "Open", ListView1.SelectedItem.Text, "", App.Path, 1)
End Sub

ItemClick 事件 
鼠标还没有点就自动上去了 很郁闷 listView1.HotTracking = True ItemClick 事件
你可以在这个事件里判断点击了哪一项,然后shell打开网页就行了。 谢谢各位的解答 因为去外地 所以没有及时结帖子 实在抱歉
补充:VB ,  控件
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,