473,469 Members | 1,542 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Putting Images into a ListView SubItem

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
2 10825
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: John Lauwers | last post by:
I know you can edit the first column of the listview control, is there a way to edit the second and/or the other columns? greets John
0
by: Anushya | last post by:
Hi I am trying to add image items to listview. Here how to handle if i need to add images?? Pls go thru the code. In the form where i have used this virtualListView, have handled...
1
by: andrewcw | last post by:
The clcik event on the ListView control seems to trigger off the item level ( the first column ). I would like to be able to trap the click event on a particular subitem ( a specific column's row...
1
by: Mark Doggett | last post by:
Hi I have a listview control with four columns. The problem I have is that the second column needs to display an image but as it is a subitem this doesn't appear to be able to be done. Does...
2
by: Paddy | last post by:
private void listView1_SelectedIndexChanged(object sender, System.EventArgs e) { textBox1.Text = this.listView1.Items.SubItems.Text; } This will display sub item after cklicking on item I...
0
by: Andrew | last post by:
If item is a ListViewItem and str is a string, why do the following two lines not have the same effect ? item.SubItems.Add(new ListViewItem.ListViewSubItem()).Text = str;...
3
by: Rob Richardson | last post by:
Greetings! I am attempting to display data in tabular form using a ListView control in detail mode. This is for a program I originally wrote in VB6. In VB6, I would add an item to the...
6
by: Jack | last post by:
Hello, I've noticed through searching this group's previous posts that one can get the item the mouse is over in a listview control but I did not see how to get the subitem the mouse is over. Is...
5
by: Martin Horn | last post by:
Hi all, I want to implement a listview with editable subitems and I assume the easiest way is to overlay a textbox over the item to be edited. With this in mind I have come up with: Using...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.