B
BobAchgill
When I try to change the Color.Lime with a string that
contains the contents "Color.Lime" I get a Casting
compile error. So how can I get past this casting issue
to change out the color programmatically?
This is the line of code without trying to change color
programmatically (no problem):
Dim LVI As New ListViewItem(New String() {myDataRow
("Id").ToString(), myDataRow("fName"), myDataRow
("lName")}, -1, Color.Empty, Color.Lime, Nothing)
Thes are the lines of code when I try to change the color
programmatically:
Dim strRowColor As Object = "Color.Lime"
Dim LVI As New ListViewItem(New String() {myDataRow
("Id").ToString(), myDataRow("fName"), myDataRow
("lName")}, -1, Color.Empty, strRowColor, Nothing)
This is the error message that I get trying to change the
color using a variable to substitute the color on the run:
"Specified cast is not valid"
What will work here to accomplish changing the color?
contains the contents "Color.Lime" I get a Casting
compile error. So how can I get past this casting issue
to change out the color programmatically?
This is the line of code without trying to change color
programmatically (no problem):
Dim LVI As New ListViewItem(New String() {myDataRow
("Id").ToString(), myDataRow("fName"), myDataRow
("lName")}, -1, Color.Empty, Color.Lime, Nothing)
Thes are the lines of code when I try to change the color
programmatically:
Dim strRowColor As Object = "Color.Lime"
Dim LVI As New ListViewItem(New String() {myDataRow
("Id").ToString(), myDataRow("fName"), myDataRow
("lName")}, -1, Color.Empty, strRowColor, Nothing)
This is the error message that I get trying to change the
color using a variable to substitute the color on the run:
"Specified cast is not valid"
What will work here to accomplish changing the color?