still with my ListView issue

  • Thread starter --== Alain ==--
  • Start date
A

--== Alain ==--

Hi,

I'm still working with my ListView custom control and i would like to
have some confirmation and help.

1. If i understood well the OnPaint event is never thrown to ListView
control ?
I tried to override it but i've seen that never it is run.

Therefore, as i want to redraw the columns header, i was thinking to
override the WndProc method but i see that a lot of work should be done
for a minimal effect.

I also tried to use OwnerDraw but refreshing of columns header is not
great. See my previous post.

2. what is the best solution for redraw the columns header ?
i mean to write text (with a special format) and also some arrow (not
images)
I would like to have the arrows on extrem right of my column header, not
directly just after the text of column header.

thanks a lot,

Al.
 
B

Ben Voigt

2. what is the best solution for redraw the columns header ?
i mean to write text (with a special format) and also some arrow (not
images)
I would like to have the arrows on extrem right of my column header, not
directly just after the text of column header.

When the column header needs to be redrawn, use InvalidateRect to let the
control know to send you the ownerdraw messages again.

This would be when the text changes, or any column header is clicked
(because that changes the sort order), etc. Each time you draw an arrow
indicating sort order, you could save the bounding rect for that column
header so then when the sort order changes you know what to invalidate. But
it's probably best to invalidate the whole header (all columns) whenever
your sort order changes.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top