I want to change the color of the group header text in listview which separates all the items into various groups, there is no such option to do that directly because no such property exists.

As far as i can think of it can be achieved via overriding the paint event but i have not done any overriding of paint events on windows controls so far.

Anyone knows how to do it ?

I would be very thankful if someone can suggest a solution.

westsiderailway commented: how to use the listview drawitem event +0

Recommended Answers

All 3 Replies

sweet man ... :cool:

so basically i can dig the listview as deep as i can afterall...

Hey would you mind answering this question as well ( if you have time)

I assume you already know how to do this or atleast read teh article...

If i set the ownerdraw property to true and then handle the drawitem event and also the drawheader event then do i have to take care of all the things ?
for example if in a certain case i want to change header portion only and leave the drawitem event to be handled by system is that possible ? or i just have to do all the things including drawing the items too ? cause i dont handle the drawitem event it wouldnt draw any items at all ...

To make owner-drawn HEADERS only, use:

Private Sub lv1_DrawItem(ByVal sender As Object, ByVal e As DrawListViewItemEventArgs) Handles lv1.DrawItem
		e.DrawDefault = True

	End Sub

	Private Sub lv1_DrawSubItem(ByVal sender As Object, _
	ByVal e As DrawListViewSubItemEventArgs) Handles lv1.DrawSubItem
		e.DrawDefault = True
	End Sub
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.