subclassing WndProc

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

--== Alain ==--

Hi,

How can i do if i want to subclass WndProc from a control to MyNewWndProc ?

in fact i have a UserControl on which i have another control (ListVire).

And i want to subclass the WndProc of ListView by MyNewWndProc function
from my UserControl.

thx.

Al.
 
How can i do if i want to subclass WndProc from a control to MyNewWndProc ?
in fact i have a UserControl on which i have another control (ListVire).

And i want to subclass the WndProc of ListView by MyNewWndProc function
from my UserControl.

Wouldn't it be easier to create a new control derived from ListView
and override the WndProc method? Then pass on any messages you want to
the parent UserControl.


Mattias
 
But in this case, can i also change behavior ("override") the properties
like columns, items and subitems to allow me to add something else than
just text ?
 
You can specify in the ListView's properties that it's OwnerDrawFixed, and
override its DrawItem (or so) method.

MSDN has a great sample under DrawItem method description.
 
Yes i know that but it is very slow, when you want to sort items...

it also shows some issue with more than 10.000 items.
 
for sure it would be easier, but there are some properties that i would
not like to expose to end user eyes (by design time or runtime mode).

Al.
 
Yes i know that but it is very slow, when you want to sort items...

it also shows some issue with more than 10.000 items.

I would suggest, if you have 10,000 or more items in the list view,
then you need to consider redesigning your app. No user wants to
scroll through 10000 items. Perhaps a grid would be more appropriate
where you can page the items?
 
Back
Top