ListView Header's Image

Dear Experts,
I'm working in a project (VC#-2008- Desktop app.)
where I need to assign images to the listview control
columns' headers

VIP Note :

I would like the image to be stretched to fit the column's header size
even if the user resizes the column

I found this article usefull
http://support.microsoft.com/kb/314933

but the image appears as it is, can't be stretched

Thanks all
RewayaAsked:
Who is Participating?
 
Bob LearnedCommented:
I mean that there is going to be a problem, if you are using an ImageList, because it will apply ImageSize equally to all images, and you can have columns that are different sizes.  I would think that if it is true that you are using an ImageList, then you need to figure out a different way, like an owner-drawn ListView.

Proof-of-concept:

http://msdn.microsoft.com/en-us/library/system.windows.forms.listview.ownerdraw.aspx
0
 
Bob LearnedCommented:
If you are using a ImageList, then the images will be fixed size.  You would need to change the ImageSize property, and that would apply equally to each column.
0
 
RewayaAuthor Commented:
Thanks TheLearnedOne
U mean I have to get the column's header size if the user resized the column
then set the image size to the new size of the header ?


0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.