Z
Zahid
Hi,
Ive got a piece of code that sets gridlines to a listview.
However I only want the horizontal lines appearing and
not the vertical. Does anyone know how to change the code
for this to happen?
Heres the code:
Public Class Helper
Public Sub New()
End Sub
Private Const LVM_GETEXTENDEDLISTVIEWSTYLE As Integer
= &H1037
Private Const LVM_SETEXTENDEDLISTVIEWSTYLE As Integer
= &H1036
Private Const LVS_EX_GRIDLINES As Integer = &H1
Private Declare Function SendMessage Lib "coredll.dll"
Alias "SendMessageW" (ByVal hWnd As Integer, ByVal wMsg
As Integer, ByVal wParam As Integer, ByVal lParam As
Integer) As Integer
Private Declare Function GetFocus Lib "coredll.dll" ()
As Integer
Public Shared Sub SetGridLines(ByVal lvw As
System.Windows.Forms.ListView)
lvw.Focus()
Dim hWnd As Integer = GetFocus()
Dim extendedStyle As Integer =
SendMessage(hWnd, LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0)
extendedStyle = extendedStyle Or LVS_EX_GRIDLINES
SendMessage(hWnd, LVM_SETEXTENDEDLISTVIEWSTYLE, 0,
extendedStyle)
Frm2.ListView1.Invalidate()
End Sub
End Class
Thanks in advance.
Ive got a piece of code that sets gridlines to a listview.
However I only want the horizontal lines appearing and
not the vertical. Does anyone know how to change the code
for this to happen?
Heres the code:
Public Class Helper
Public Sub New()
End Sub
Private Const LVM_GETEXTENDEDLISTVIEWSTYLE As Integer
= &H1037
Private Const LVM_SETEXTENDEDLISTVIEWSTYLE As Integer
= &H1036
Private Const LVS_EX_GRIDLINES As Integer = &H1
Private Declare Function SendMessage Lib "coredll.dll"
Alias "SendMessageW" (ByVal hWnd As Integer, ByVal wMsg
As Integer, ByVal wParam As Integer, ByVal lParam As
Integer) As Integer
Private Declare Function GetFocus Lib "coredll.dll" ()
As Integer
Public Shared Sub SetGridLines(ByVal lvw As
System.Windows.Forms.ListView)
lvw.Focus()
Dim hWnd As Integer = GetFocus()
Dim extendedStyle As Integer =
SendMessage(hWnd, LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0)
extendedStyle = extendedStyle Or LVS_EX_GRIDLINES
SendMessage(hWnd, LVM_SETEXTENDEDLISTVIEWSTYLE, 0,
extendedStyle)
Frm2.ListView1.Invalidate()
End Sub
End Class
Thanks in advance.