프로그래밍

[vb.net] listview drag select for windows 7

프로세스 천국 2013. 6. 13. 23:38

Windows 7 운영체제에서 리스트뷰를 선택할때 열 내에서는 드래그 멀티셀렉트가 먹히지 않는다.

Shift 키를 눌러서 선택하면 되긴 하지만 이게 여간 귀찮은게 아니다.

 

 

'listview drag select for windows 7 start
Private mouseDownLV As Boolean
Private Sub ListView1_MouseDown(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles ListView1.MouseDown
mouseDownLV = True
End Sub
Private Sub ListView1_MouseMove(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles ListView1.MouseMove
If mouseDownLV Then
Try
Dim i = ListView1.HitTest(e.Location).Item.Index
ListView1.Items(i).Selected = True
Catch ' ex As Exception
End Try
End If
End Sub
Private Sub ListView1_MouseUp(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles ListView1.MouseUp
mouseDownLV = False
End Sub
'listview drag select for windows 7 end

 

 

http://www.vbforums.com/showthread.php?678018-RESOLVED-ListView-MultiSelect-rows-with-mouse-drag-Win7