By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,069 Members | 1,249 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,069 IT Pros & Developers. It's quick & easy.

Putting Images into a ListView SubItem

P: n/a
Greetings:

Is it possible to put a small image into a ListView item when the target
item is NOT the item 0 (ie: its not the item on the left-most column).

What I am trying to accomplish is to create a list representing some real
world items with various options and features. I would like to have a column
called T-Sensor (which indicates whether or not a temperature sensor is
installed). I would prefer that this column use a graphic (like a check-box)
to indicate yes or no, rather than actual text that says "YES" or "NO". Each
item has quite a few "yes/no" columns like this and I think it would look
more professional and slick if check-boxes were used.

Thank you,
Mark
Nov 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
You need to owner-draw your items.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"Mark Roberts" <mc*******@sympatico.ca> wrote in message
news:eC****************@TK2MSFTNGP15.phx.gbl...
Greetings:

Is it possible to put a small image into a ListView item when the target
item is NOT the item 0 (ie: its not the item on the left-most column).

What I am trying to accomplish is to create a list representing some real
world items with various options and features. I would like to have a
column called T-Sensor (which indicates whether or not a temperature
sensor is installed). I would prefer that this column use a graphic (like
a check-box) to indicate yes or no, rather than actual text that says
"YES" or "NO". Each item has quite a few "yes/no" columns like this and I
think it would look more professional and slick if check-boxes were used.

Thank you,
Mark

Nov 17 '05 #2

P: n/a
Hi Bob:

Thanks for your response. I'm a bit puzzled though...

From what I can tell, it is "ListBox" that supports the owner draw feature
and ListView does not. At the same time though, ListBox does not seem to
have a setting for "report view" (aka "details").

Can I Owner Draw a ListView? If so, how?

I would really like to learn how to customize controls in C# but I'm a
little bewildered by the complexity of them. Can you recommend a good
reference or starting point?

Thank you,
Mark
"Bob Powell [MVP]" <bob@_spamkiller_bobpowell.net> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
You need to owner-draw your items.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"Mark Roberts" <mc*******@sympatico.ca> wrote in message
news:eC****************@TK2MSFTNGP15.phx.gbl...
Greetings:

Is it possible to put a small image into a ListView item when the target
item is NOT the item 0 (ie: its not the item on the left-most column).

What I am trying to accomplish is to create a list representing some real
world items with various options and features. I would like to have a
column called T-Sensor (which indicates whether or not a temperature
sensor is installed). I would prefer that this column use a graphic (like
a check-box) to indicate yes or no, rather than actual text that says
"YES" or "NO". Each item has quite a few "yes/no" columns like this and I
think it would look more professional and slick if check-boxes were used.

Thank you,
Mark


Nov 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.