subclassing WndProc

  • Thread starter --== Alain ==--
  • 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.
 
M

Mattias Sjögren

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
 
A

--== Alain ==--

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 ?
 
A

Ashot Geodakov

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.
 
A

--== Alain ==--

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.
 
A

--== Alain ==--

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.
 
C

Chris Dunaway

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?
 

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