hi, I'm new to vb.net and I need some help, I done a backcolor change to my list view item as below code,
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
objItem = lvMedic.Items.Add("cb034")
With objItem
.SubItems.Add("Saliva Glukosa")
.SubItems.Add("Lotion")
.SubItems.Add("20.00")
.SubItems.Add("10")
.SubItems.Add("01/01/2005")
.SubItems.Add("01/20/2008")
.SubItems.Add(countDayLeft)
End With
If objItem.Index Mod 2 = 0 Then
objItem.BackColor = Color.AliceBlue
ElseIf objItem.Index Mod 10 = 9 Then
objItem.BackColor = Color.Wheat
Else
objItem.BackColor = Color.Cornsilk
End If
end sub
tis code work fine, but when i delete an item, the color won't change correctly, mean when i delete old index=9 item, it won't automatic change the new index=9 item color to color.wheat, anyone can provide some help?
1 1358
hi, I'm new to vb.net and I need some help, I done a backcolor change to my list view item as below code,
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
objItem = lvMedic.Items.Add("cb034")
With objItem
.SubItems.Add("Saliva Glukosa")
.SubItems.Add("Lotion")
.SubItems.Add("20.00")
.SubItems.Add("10")
.SubItems.Add("01/01/2005")
.SubItems.Add("01/20/2008")
.SubItems.Add(countDayLeft)
End With
If objItem.Index Mod 2 = 0 Then
objItem.BackColor = Color.AliceBlue
ElseIf objItem.Index Mod 10 = 9 Then
objItem.BackColor = Color.Wheat
Else
objItem.BackColor = Color.Cornsilk
End If
end sub
tis code work fine, but when i delete an item, the color won't change correctly, mean when i delete old index=9 item, it won't automatic change the new index=9 item color to color.wheat, anyone can provide some help?
Problem Solved, no Help Needed Anymore
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Stan Brown |
last post by:
http://www.acad.sunytccc.edu/instruct/sbrown/stat15/demo.htm
http://www.acad.sunytccc.edu/instruct/sbrown/npscreen.css
The first table is floated right (class="fr"). Text does not flow
around...
|
by: JIM.H. |
last post by:
Hello,
I have a dropdown list, updated through a dataset. After bind, I use this to
add extra item to my dropdown list. myDropDownList.Items.Add(“Item1”), I can
remove that by using...
|
by: Zorpiedoman |
last post by:
The problem is this:
I have a list box. I set an array list as the datasource. I remove an item
from the array list. I set the listbox datasource to nothing. I set the
listbox datasource to...
|
by: Brian Henry |
last post by:
Here is another virtual mode example for the .NET 2.0 framework while
working with the list view. Since you can not access the items collection of
the list view you need to do sorting another...
|
by: Rylios |
last post by:
I am trying to make a very basic text editor using a linked list,
fstream, sorting...
This is what i have so far...
|
by: Josh Mcfarlane |
last post by:
Just out of curiosity:
When would using std::list be more efficient / effective than using
other containers such as vector, deque, etc?
As far as I'm aware, list doesn't appear to be...
|
by: Brian Henry |
last post by:
So what is the easiest way to do this? I have one list view with a list of
items (in detail view and with about 20 sub items) and a second list view
that will take the items they drag from the...
|
by: dustin.getz |
last post by:
consider the following working loop where Packet is a subclass of
list, with Packet.insert(index, iterable) inserting each item in
iterable into Packet at consecutive indexes starting at index.
...
|
by: henry.onovwaka |
last post by:
Can someone help on this problem.
I have a combo box of, say three Items, selected from a table that
serves as the lookup: E.g. 1 Earth, 2 Pine, 3 Earth Grave
The combo box is on the subform.
...
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
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...
|
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...
|
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,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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$) {
}
...
|
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
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
| |