Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 792
  • Last Modified:

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
0
Rewaya
Asked:
Rewaya
  • 2
1 Solution
 
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
 
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

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now