I have a ListView that displays some items (it's not important what they are really). However, what IS important is that the items it displays can have a property of "IsEnabled" or not. By default I only want to show the items where IsEnabled is true. I have therefore provided a checkbox for the user to allow him/her to show all the items, enabled or not.

Now, what I want to do is to show the items that are Disabled in red and enabled items in black. The code below works but it just doesn't look right to me. Is there a better way?

The code is called everytime the CheckBox is clicked.

VB Code:
  1. Private Sub GetPackages()
  2.         Me.Cursor = Cursors.WaitCursor
  3.         Me.lv_Packages.Items.Clear()
  4.         Try
  5.             objAltirisClient = CreateObject("Altiris.AeXNSClient", ComputerName)
  6.         Catch ex As Exception
  7.             MessageBox.Show("There was an error connecting to the Altiris Client.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
  8.             Me.Cursor = Cursors.Default
  9.             Return
  10.         End Try
  11.         objSWDAgent = objAltirisClient.ClientPolicyMgr.ClientAgent("Altiris.SWD")
  12.         Dim ColAdvertisements As Object = objSWDAgent.Advertisements
  13.  
  14.         For Each objAdvert As Object In ColAdvertisements
  15.  
  16.             Dim LVI As New ListViewItem
  17.             LVI.Tag = objAdvert.ID
  18.             LVI.Text = objAdvert.Name
  19.  
  20.             If Me.check_ShowDisabledPackages.Checked = False Then
  21.  
  22.                 If objAdvert.IsEnabled = 1 Then
  23.                     Me.lv_Packages.Items.Add(LVI)
  24.                 End If
  25.             Else
  26.                 If objAdvert.IsEnabled = 1 Then
  27.                     Me.lv_Packages.Items.Add(LVI)
  28.                 Else
  29.                     LVI.ForeColor = Color.Red
  30.                     Me.lv_Packages.Items.Add(LVI)
  31.                 End If
  32.             End If
  33.         Next
  34. End Sub