Imports Infragistics.Win
Imports Infragistics.Win.UltraWinListView
Private Sub InitializeVisualAppearance()
' Set the ImageTransparentColor property to Magenta, so
' that pixels of that color will be masked out of images
Me.ultraListView1.ImageTransparentColor = Color.Magenta
' Use the ImageBackground property of the control's Appearance to display a watermark
Me.ultraListView1.Appearance.ImageBackground = Image.FromFile("C:\watermark.bmp")
Me.ultraListView1.Appearance.ImageBackgroundStyle = ImageBackgroundStyle.Centered
' Use the GroupAppearance to configure the visual appearance for all groups
Me.ultraListView1.GroupAppearance.FontData.Name = "Tahoma"
Me.ultraListView1.GroupAppearance.FontData.SizeInPoints = 12.0F
Me.ultraListView1.GroupAppearance.TextHAlign = HAlign.Center
' Use a solid border note that this only applies when no OS themes are active
Me.ultraListView1.BorderStyle = UIElementBorderStyle.Solid
Me.ultraListView1.Appearance.BorderColor = Color.LightBlue
' Assign Color.LightBlue to the BackColor property of the ItemSettings' ActiveAppearance
Me.ultraListView1.ItemSettings.ActiveAppearance.BackColor = Color.LightBlue
' Assign Color.Black to the ForeColor property of the ItemSettings' Appearance
Me.ultraListView1.ItemSettings.Appearance.ForeColor = Color.Black
' Use a gradient to depict the HotTracking background
Me.ultraListView1.ItemSettings.HotTrackingAppearance.BackColor2 = Color.LightBlue
Me.ultraListView1.ItemSettings.HotTrackingAppearance.BackGradientStyle = GradientStyle.Vertical
End Sub
Private Sub ultraListView1_ItemActivating(ByVal sender As System.Object, ByVal e As Infragistics.Win.UltraWinListView.ItemActivatingEventArgs) Handles ultraListView1.ItemActivating
Dim listView As UltraListView = CType(sender, UltraListView)
Dim oldActiveItem As UltraListViewItem = listView.ActiveItem
Dim newActiveItem As UltraListViewItem = e.Item
' If the item that is about to be activated belongs to
' a different group than the last active item, reset
' the last active group's appearance
If Not oldActiveItem Is Nothing AndAlso _
Not oldActiveItem.Group Is Nothing AndAlso _
Not newActiveItem.Group Is Nothing AndAlso _
Not oldActiveItem.Group Is newActiveItem.Group Then
oldActiveItem.Group.ResetAppearance()
End If
End Sub
Private Sub ultraListView1_ItemActivated(ByVal sender As System.Object, ByVal e As Infragistics.Win.UltraWinListView.ItemActivatedEventArgs) Handles ultraListView1.ItemActivated
' Set the ForeColor of the new ActiveItem's Group's Appearance to red.
If Not e.Item.Group Is Nothing Then e.Item.Group.Appearance.ForeColor = Color.Red
End Sub