|
-
August 11th, 1999, 11:19 AM
#1
ListViews
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!!
-
August 11th, 1999, 12:58 PM
#2
Re: ListViews
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
-
August 11th, 1999, 01:00 PM
#3
Re: ListViews
Wow... sorry, wasn't in the good forum 
Marc
-
August 12th, 1999, 02:44 AM
#4
Re: ListViews
If you're using VB6, then it's one of the properties (i guess it's called ShowGridlines)
Crazy D :-)
-
August 12th, 1999, 03:40 AM
#5
Re: ListViews
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|