4

Does anyone have any info on creating/drawing a customised ListView object?

Currently Im working on a project that requires a customised look and feel within the application. I am using a standard (Windows.Forms) ListView which is not in the same style as the rest of the GUI. We are NOT using a toolbox for custom controls, all controlls are 'skinned' inhouse as it were by overriding hte OnPaint() method for each control.

What Im looking for is: - Information about how to handle drawing of the Scroll Bar. - How to use customised drawing routines to handle the column headers. - How to still handle the data shown and draw that correctly.

Any and all help would be greatly received.

2 Answers 2

2

Subclass ListBox. In the ctor, set the draw mode to OwnerDrawVariable and override OnDrawItem and OnMeasureItem. I like to have a special Item class which allows the user to specify any custom drawing for that item as well as an object which will be the data.

Sign up to request clarification or add additional context in comments.

Comments

1

From what I can tell you will need to actually make some Win32 calls using NM_CUSTOMDRAW to actually change the paint behavior of the control. Here is one article I found. You are going to have to do a bit more digging.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.