0
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim lCount As Integer
        For lCount = 1 To 5
            ListView1.Items.Add(lCount.ToString)
        Next

        If ListView1.Items.Count > 0 Then
            ListView1.Items(0).Selected = True
        End If

I have even write the code to select the first node,i want first row should be blue(Selected). But its not coming to be blue?

2
Contributors
2
Replies
24
Views
8 Years
Discussion Span
Last Post by ritu verma
0
ListView1.View = View.Details
        ListView1.HideSelection = False
        ListView1.FullRowSelect = True

        Dim lCount As Integer
        ListView1.Columns.Add("No", 100)
        For lCount = 1 To 5
            ListView1.Items.Add(lCount.ToString)
        Next

        If ListView1.Items.Count > 0 Then
            ListView1.Items(0).Selected = True
        End If
0

hi adatapost,I already set view to details. I just set the tab order of listview to 0 & its done.

Dim lCount As Integer
        Dim lvitem As ListViewItem

        For lCount = 1 To 5
            lvitem = ListView1.Items.Add(lCount.ToString)
            lvitem.SubItems.Add("A")
        Next

        If ListView1.Items.Count > 0 Then
            ListView1.Items(0).Selected = True
            ListView1.Items(0).EnsureVisible()
        End If
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.