Solved

ListView Header's Image

Posted on 2009-05-07
4
779 Views
Last Modified: 2013-12-17
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
Comment
Question by:Rewaya
  • 2
4 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 24332290
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
 

Author Comment

by:Rewaya
ID: 24362112
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
 
LVL 96

Accepted Solution

by:
Bob Learned earned 500 total points
ID: 24363278
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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Flash (http://en.wikipedia.org/wiki/Adobe_Flash) has evolved over the years to where it has become a masterful tool for displaying content screen.  It has excellent layout placement, UI precision as well as rendering capabilities. This, along with t…
A basic question.. “What is the Garbage Collector?” The usual answer given back: “Garbage collector is a background thread run by the CLR for freeing up the memory space used by the objects which are no longer used by the program.” I wondered …
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

815 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now