Solved

ListView Header's Image

Posted on 2009-05-07
4
776 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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Summary Displaying images in RichTextBox is a common requirement with limited solutions available. Pasting through clipboard or embedding into RTF content only support static images.  This article describes how to insert Windows control objects int…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

746 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

12 Experts available now in Live!

Get 1:1 Help Now