How to add image to ColumnHeader in .Net Compact Framework?

G

Guest

Does anyone know how to add an image to the ColumnHeader control in the .Net Compact Framework?

The Microsoft Windows CE .NET 4.2 documentation has an article "Working with Advanced Header Control Features" which describes how you can do this non .Net code, so it should be possible in .Net too; has any one got this working, or do I need to write my own code?

I've been able to get the hwnd for my listview (by using Win32 API GetWindow), and from there the hwnd for the HeaderControl (using the LVM_GETHEADER message). Now I'm stuck because I need the handle to the ImageList control, so I can do something like:

SendMessage(hwndHeaderControl, HDM_SETIMAGELIST, 0U, (uint)hwndImageList);

where hwndImageList is supposed to be a handle to my System.Windows.Forms.ImageList which holds the images. Just how do I get this hwndImageList? Or am I barking at totally the wrong tree?

Thanks.
 
C

Chris Tacke, eMVP

You simply can't do it. Maybe an owner-drawn list would work?

There's one at
www.opennetcf.org/sdf

-Chris

astanley said:
Does anyone know how to add an image to the ColumnHeader control in the ..Net Compact Framework?

The Microsoft Windows CE .NET 4.2 documentation has an article "Working
with Advanced Header Control Features" which describes how you can do this
non .Net code, so it should be possible in .Net too; has any one got this
working, or do I need to write my own code?
I've been able to get the hwnd for my listview (by using Win32 API
GetWindow), and from there the hwnd for the HeaderControl (using the
LVM_GETHEADER message). Now I'm stuck because I need the handle to the
ImageList control, so I can do something like:
SendMessage(hwndHeaderControl, HDM_SETIMAGELIST, 0U, (uint)hwndImageList);

where hwndImageList is supposed to be a handle to my
System.Windows.Forms.ImageList which holds the images. Just how do I get
this hwndImageList? Or am I barking at totally the wrong tree?
 
L

Lloyd Dupont

yep you could do it with our OpenSource table control.
I should really updated it soon as Ihave fixed many refresh bug and improve
the editors ....
(alternally you could ask me the latest version)

go there:
http://www.ihook.cc

clic on OpenSource

astanley said:
Does anyone know how to add an image to the ColumnHeader control in the ..Net Compact Framework?

The Microsoft Windows CE .NET 4.2 documentation has an article "Working
with Advanced Header Control Features" which describes how you can do this
non .Net code, so it should be possible in .Net too; has any one got this
working, or do I need to write my own code?
I've been able to get the hwnd for my listview (by using Win32 API
GetWindow), and from there the hwnd for the HeaderControl (using the
LVM_GETHEADER message). Now I'm stuck because I need the handle to the
ImageList control, so I can do something like:
SendMessage(hwndHeaderControl, HDM_SETIMAGELIST, 0U, (uint)hwndImageList);

where hwndImageList is supposed to be a handle to my
System.Windows.Forms.ImageList which holds the images. Just how do I get
this hwndImageList? Or am I barking at totally the wrong tree?
 
J

Jeff

Lloyd -

I'm running into the same issue (adding images to listview headers)
posted by astanley. When you responded to him, you offered (on
request) the latest version of your opensource table control that
would solve this problem. Can you please also send it to me (jeffg22
<AT> mindspring.com)?

By the way, I visited the URL you suggested in your post
(http://www.ihook.cc) to look for the OpenSource link, but I couldn't
find the link.

Thanks for your help.

- Jeff
 

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