473,382 Members | 1,635 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,382 software developers and data experts.

ListView

Lou
How do I get the background color of a single cell to change.
i tried
Dim item1 As New ListViewItem(node_name.InnerText, 1)

item1.SubItems.Item(0).BackColor = vbColor.Red

but that colors the entir row??
Nov 20 '05 #1
6 10212
Hello,

"Lou" <lo********@comcast.net> schrieb:
How do I get the background color of a single cell to change.
i tried
Dim item1 As New ListViewItem(node_name.InnerText, 1)

item1.SubItems.Item(0).BackColor = vbColor.Red

but that colors the entir row??


The 'BackColor' property only works for the first item in the row and will
be used for all items in the row. If you set an other bacckground color for
other items, they will be ignored.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #2
Lou
So how does one color just one cell?

"Herfried K. Wagner [MVP]" <hi*******@m.activevb.de> wrote in message
news:em**************@TK2MSFTNGP11.phx.gbl...
Hello,

"Lou" <lo********@comcast.net> schrieb:
How do I get the background color of a single cell to change.
i tried
Dim item1 As New ListViewItem(node_name.InnerText, 1)

item1.SubItems.Item(0).BackColor = vbColor.Red

but that colors the entir row??
The 'BackColor' property only works for the first item in the row and will
be used for all items in the row. If you set an other bacckground color

for other items, they will be ignored.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet

Nov 20 '05 #3
"Lou" <lo********@comcast.net> schrieb
How do I get the background color of a single cell to change.
i tried
Dim item1 As New ListViewItem(node_name.InnerText, 1)

item1.SubItems.Item(0).BackColor = vbColor.Red

but that colors the entir row??


Here it doesn't color anything. When setting the UseItemStyleForSubItems to
False, only the backcolor of the subitem is changed.
--
Armin

Nov 20 '05 #4
Hello,

"Lou" <lo********@comcast.net> schrieb:
So how does one color just one cell?


You will need to draw the items yourself (a custom drawn listview). Are you
very familiar with .NET programming?

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #5
Hello,

"Armin Zingler" <az*******@freenet.de> schrieb:
Here it doesn't color anything. When setting the
UseItemStyleForSubItems to False, only the backcolor
of the subitem is changed.


Agrrhraaaaa... you are right...

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #6
Hello,

"Herfried K. Wagner [MVP]" <hi*******@m.activevb.de> schrieb:
[Nonsense]

Forget this posting. Have a look at Armin's suggestion! Shame on me.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #7

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

Similar topics

6
by: Anushya | last post by:
Hi I am using Listview and inherited listview control overriding WndProc & PreProcessMessage in ListView. I need this to customize listview to display only the page the user scrolls to. Since i...
0
by: Anushya | last post by:
Hi I am using Listview and inherited listview control overriding WndProc & PreProcessMessage in ListView. I need this to customize listview to display only the page the user scrolls to. Since i...
0
by: keith | last post by:
In a ListView control (two columns), I added a few ListView items. ListView listview=new ListView(); listview.Parent=this; listview.View=View.Details; listview.Columns.Add...
7
by: Dave Y | last post by:
I am a newbie to C# and am having trouble trying to override a ListView property method. I have created a new class derived from the Forms.Listview and I cannot figure out the syntax to override...
7
by: BobAchgill | last post by:
I am trying to decide which of these controls to use to implement letting my user select a full row from MyList. The MyList has several columns which would be nice to sort by at run time. The...
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
by: Peter | last post by:
Hi, I have a problem with Listview using checkboxes. If i check items by code BEFORE the form is shown the Listview.Items are confused during the ItemChecked Event !!! After showing the...
2
by: Peter | last post by:
Hi, I have a problem with Listview using checkboxes. If i check items by code BEFORE the form is shown the Listview.Items are confused during the ItemChecked Event !!! After showing the...
4
by: Brian Gaze | last post by:
I have created a ListView control and have bound this to a datasource. Within the ItemTemplate of the ListView I have added another ListViewControl which is databound in the code behind. The idea...
1
by: =?Utf-8?B?UmF5IE1pdGNoZWxs?= | last post by:
Hello, In my application I need to periodically remove all current items from a ListView and add a new set into it. The following abbreviated code contains the basic idea: private void...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.