Click here to Skip to main content
15,899,126 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In my program, I want to make a treeview has different background color.Item that occupy the odd line has a background color, occupy the even line has a different background color.When I init the treeview using the custom draw, this can be done.But when the treeview is expanded or collapsed, problems happened.Sibling item next the expanded item,won't change the background color if it changes the odd line or even line.Because the system won't repaint the item.Can I use some ways to solve the problem?
Posted

1 solution

Try Invalidating[^] it. Set the 2nd parameter, lpRect, to NULL. This will make the whole control repaint. Assuming your code for setting the line colour is correct, this will work.
Probably no need to erase, but see what works with that last parameter
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900