473,396 Members | 1,671 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Image Columns in ListView

Hello,

I am trying to create a ListView object on my form with two columns. A
small, 32 pixel wide column on the left for holding images, and a column
that takes up the rest of the ListView on the right for storing text.

My question is this: how do I store images in this first column? I see all
kinds of support for small icon images and large icon images, but those are
for views that I do not want. Is there any way to do this?

Thanks,
Marc W.
Nov 15 '05 #1
3 14862
Hello Marc,

ListView supports so called "status images". These are small icons displayed
to the left of the item (that is, the leftmost column in the view) and work
in the Report mode you probably want your view to display itself in. They,
however, AFAIK are not supported at the Framework level and you might need
to do some amount of P/Invoke to the appropriate Windows APIs to enable this
feature. I believe I have seen an article on some website (was it
CodeProject?) that demonstrated how to do that.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Marc W." <ma**********@hotmail.com> wrote in message
news:eR*************@TK2MSFTNGP11.phx.gbl...
Hello,

I am trying to create a ListView object on my form with two columns. A
small, 32 pixel wide column on the left for holding images, and a column
that takes up the rest of the ListView on the right for storing text.

My question is this: how do I store images in this first column? I see all
kinds of support for small icon images and large icon images, but those are for views that I do not want. Is there any way to do this?

Thanks,
Marc W.


Nov 15 '05 #2
On Sun, 30 Nov 2003 12:00:28 -0500, "Marc W."
<ma**********@hotmail.com> wrote:
Hello,

I am trying to create a ListView object on my form with two columns. A
small, 32 pixel wide column on the left for holding images, and a column
that takes up the rest of the ListView on the right for storing text.

My question is this: how do I store images in this first column? I see all
kinds of support for small icon images and large icon images, but those are
for views that I do not want. Is there any way to do this?

Thanks,
Marc W.


Marc

Can you 'cheat' and add a ListView item with no text, just an icon,
and then a sub-item with your text? Something like:

lvItem = new ListViewItem("", intIconIndex);
lvItem.SubItems.Add("Your text");
lvMain.Items.Add(lvItem);

All you would need to do then is set up an ImageList and associate the
ListView with it.

--
Jeff Gaines Damerham Hampshire UK

Nov 15 '05 #3
Hi Marc
Do u have the soln?? pls mail me to v_*******@hotmail.com
-----Original Message-----
Hello Marc,

ListView supports so called "status images". These are small icons displayedto the left of the item (that is, the leftmost column in the view) and workin the Report mode you probably want your view to display itself in. They,however, AFAIK are not supported at the Framework level and you might needto do some amount of P/Invoke to the appropriate Windows APIs to enable thisfeature. I believe I have seen an article on some website (was itCodeProject?) that demonstrated how to do that.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Marc W." <ma**********@hotmail.com> wrote in message
news:eR*************@TK2MSFTNGP11.phx.gbl...
Hello,

I am trying to create a ListView object on my form with two columns. A small, 32 pixel wide column on the left for holding images, and a column that takes up the rest of the ListView on the right for storing text.
My question is this: how do I store images in this first column? I see all kinds of support for small icon images and large icon images, but those
are
for views that I do not want. Is there any way to do

this?
Thanks,
Marc W.


.

Nov 15 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Samuel R. Neff | last post by:
I'm having a index problem with ListView SubItems. If I add multiple columns to the listview and then add items with associated subitems, the ListView displays fine. Then if I delete a column via...
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...
0
by: CR | last post by:
I'm having a problem with the Listview control. I populated a Listview with 4 columns. On my PC they show up just fine, the right hand edge of the 4th column lines up with the right hand edge of...
0
by: Silvia | last post by:
Hi, I have a program that capture images and put this into a listview (using imagelist), the problem is when I delete de image the listview, when do that and capture another image, the image...
3
by: simchajoy2000 | last post by:
Hi, I am trying to use a VB.NET listview object to display information from a datatable. I need to have two columns of information but I don't want the user to be able to select each column...
10
by: Adam Honek | last post by:
This is probably a silly question but oh well, I can't find the answer looking via code. Having an imagelist already, how does one set an icon for a list view's sub items? I'm using the code...
2
by: mrmagoo | last post by:
I'm trying to fill a listview with data. I'm using the example from the help file, but how do I modify this to avoid using images? I want the exact same layout but without images. This procedure...
5
by: John Devlon | last post by:
Hi, Does anyone know how to get a value of a second column of a selected item in Listview. I've create a listview and added this code Listview.Items.Clear() Listview.Columns.Clear()...
0
parshupooja
by: parshupooja | last post by:
Contact Reply 1 point Member propoo Joined on 08-31-2007, 10:32 PM Posts 3 Hey all ,
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.