Click to See Complete Forum and Search --> : ListViews
ehegarty
August 11th, 1999, 11:19 AM
I have a Report Style List View but i want to it look like a DBGrid with Horizontal and vertical lines.
Can anyone help??
Also, can you have a DBGrid which is not associated with a Data Source control
i.e by adding column headers and information yourself!!
Marc L'Ecuyer
August 11th, 1999, 12:58 PM
Just use the LVS_EX_GRIDLINES :
DWORD dwExStyle= myList.GetExtendedStyle();
myList.SetExtendedStyle(dwExStyle | LVS_EX_GRIDLINES);
If you don't like the look of these lines, you can use the LVS_OWNERDRAWFIXED style to draw the content of your list.
Marc
Marc L'Ecuyer
August 11th, 1999, 01:00 PM
Wow... sorry, wasn't in the good forum :)
Marc
Crazy D @ Work
August 12th, 1999, 02:44 AM
If you're using VB6, then it's one of the properties (i guess it's called ShowGridlines)
Crazy D :-)
Chris Eastwood
August 12th, 1999, 03:40 AM
If you're using VB5, you can use the following code to turn on / off grid lines :
- Place the following into a BAS module (or into a form - just don't forget to change the 'Publics' as appropriate)
public Declare Function SendMessageLong Lib "user32" Alias "SendMessageA" (byval hwnd as Long, byval Msg as Long, byval wParam as Long, byval lParam as Long) as Long
'
' ListView API Constants
'
public Const LVM_FIRST as Long = &H1000
public Const LVM_SETEXTENDEDLISTVIEWSTYLE as Long = LVM_FIRST + 54
public Const LVS_EX_GRIDLINES = &H1
'
' Show Grid Lines Routine - Call with :
'
' ShowGridLines ListView1.Hwnd, true
'
public Sub ShowGridLines(byval lLVHwnd as Long, byval bShowGridLines as Boolean)
'
SendMessageLong lLVHwnd, LVM_SETEXTENDEDLISTVIEWSTYLE, LVS_EX_GRIDLINES, bShowGridLines
'
End Sub
Chris Eastwood
CodeGuru - the website for developers
http://www.codeguru.com/vb
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.