Windows XP
(1)
Windows Server 2003
(1)
SetExtendedStyle
(1)
CListCtrl
(1)
CodeProject
(1)
CorollaX
(1)
CorollaY
(1)
February
(1)

CListCtrl Advanced Grid Line Draw

Asked By Chris
13-Jan-10 09:39 PM
I am developing an application using MFC 4.2.

The LVS_EX_GRIDLINES style is not supported on this version of MFC so I need
to subclass the CListCtrl class and draw it myself.

What become problem is that I must draw the grid lines based on the item
grouping like this:
__________________________________
|  ID  |  Type  |   Category   |     Brand  |
------------------------------------------------
| ID1 | Car     |  Sports Car  | Ferrari360|
|       |           |                    | Lamborgi  |
|       |           |                    | Porsche25|
------------------------------------------------
|       |            |  Family Car | CorollaX   |
|       |            |                   | CorollaY   |
------------------------------------------------
|        | Boat    |  Power Boat| BMW Boat |
|        |           |                   |Super Boat |
-------------------------------------------------
|        |           |  Cruise Boat| Cruise 1    |
|        |           |                   | Cruise 2    |
-------------------------------------------------

Thank you very much.

That define should be in the 6.0 Windows SDK in the CommCtrl.h file.

Tom Serface replied to Chris
14-Jan-10 02:26 AM
That define should be in the 6.0 Windows SDK in the CommCtrl.h file.  You
should be able to use it.  I have not used VC6 for a long time so I could be
off, but I think you can use them.  The define looks like:


I think this is more dependent on the version of the common controls
installed (like with Internet Explorer 4+) than it is the version of MFC.  I
think the CListCtrl implementation for MFC 4.2 may not have had
SetExtendedStyle(), but it may be easy to add your own by just deriving from
the CListCtrl and adding a new function that sends the message to the
control to set the extended styles.

Tom

You may find this article on CodeProject to be interesting:http://www.

Giovanni Dicanio replied to Chris
14-Jan-10 05:29 AM
You may find this article on CodeProject to be interesting:

http://www.codeproject.com/KB/list/CListCtrl_Grouping.aspx

If you are using VC6 and you want to use the new features of list-controls
available in Windows XP (like grouping), I think that you may want to
download the latest Platform SDK available for that IDE, i.e. the Windows
Server 2003 PSDK (February 2003):

http://www.microsoft.com/msdownload/platformsdk/sdkupdate/psdk-full.htm

HTH,
Giovanni
Post Question To EggHeadCafe