Do .NET controls have equivalent of LPSTR_TEXTCALLBACK

D

David Connet

Let's try this with a better subject since I didn't get any responses
before...

Do the .NET list controls (trees, etc) have the equivalent of
LPSTR_TEXTCALLBACK/I_IMAGECALLBACK/etc? I'm trying to port an existing
application that makes extensive use of LVN_GETDISPINFO and would prefer
not changing all that logic...

Thankx!
Dave Connet
Entelos, Inc.
 
O

Otis Mukinfus

Let's try this with a better subject since I didn't get any responses
before...

Do the .NET list controls (trees, etc) have the equivalent of
LPSTR_TEXTCALLBACK/I_IMAGECALLBACK/etc? I'm trying to port an existing
application that makes extensive use of LVN_GETDISPINFO and would prefer
not changing all that logic...

Thankx!
Dave Connet
Entelos, Inc.
It might be helpful if you would tell us what those things do, or are.

Otis Mukinfus
http://www.arltex.com
http://www.tomchilders.com
 
R

Roger

I believe this depends on which version of .NET you're using. If I
understand you correctly, you're asking about owner-drawn controls,
which lets user specify how to draw an item in a list or tree view?

..NET 2003 only has owner-drawn list boxes. But I believe that .NET
2005 also supports owner-drawn tree views and list views (I haven't
upgraded yet, so I'm not sure).

This might be a good article to start with:
http://msdn.microsoft.com/library/d...stemwindowsformslistboxclassdrawitemtopic.asp
 
D

David Connet

I believe this depends on which version of .NET you're using. If I
understand you correctly, you're asking about owner-drawn controls,
which lets user specify how to draw an item in a list or tree view?

.NET 2003 only has owner-drawn list boxes. But I believe that .NET
2005 also supports owner-drawn tree views and list views (I haven't
upgraded yet, so I'm not sure).

This might be a good article to start with:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/
html/frlrfsystemwindowsformslistboxclassdrawitemtopic.asp

No, it's not really owner-draw. In Win32, the Listctrl and Treectrl
send you a [LT]VN_GETDISPINFO message (via WM_NOTIFY) when they need
to display text (that is, when you set the text to LPSTR_TEXTCALLBACK
when the item is inserted). In the message, a structure is provided
where you copy the text. So the control is still doing _all_ of the
drawing - you are simply supplying the text on an as-needed basis.

When you have a large number of items, one of the things this does is
significantly cut down on memory usage since you are not inserting
a copy of the data you already have. (I normally use listctrls in
report mode)

Dave Connet
 

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