?
Solved

ListView Header's Image

Posted on 2009-05-07
4
Medium Priority
?
787 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

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

Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

770 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