Roxbury Posted July 4, 2006 Posted July 4, 2006 If the user that is put into the listview is Roxbury or Roxbury22 then I need the text to be red, however, it is remaining the default white...Can anyone help me here? ListView1.Items.Clear() Dim I As Integer For I = 1 To users.Length - 1 ListView1.Items.Add(users(I)) If ListView1.Items(I).Text = "Roxbury" Or "Roxbury22" Then ListView1.Items(I).ForeColor = Color.Red End If Next Quote
Cags Posted July 4, 2006 Posted July 4, 2006 Whether .Net 2.0 is different I don't know, but in 1.1 at least the following code will not run because "Roxbury22" can't be cast to a boolean. If ListView1.Items(I).Text = "Roxbury" Or "Roxbury22" Then ListView1.Items(I).ForeColor = Color.Red End If The following code works for me... If ListView1.Items(I).Text = "Roxbury" Or ListView1.Items(I).Text ="Roxbury22" Then ListView1.Items(I).ForeColor = Color.Red End If Quote Anybody looking for a graduate programmer (Midlands, England)?
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.