Click here to Skip to main content
15,897,187 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all

I wrote the below to and loading the data in listview

VB
Try
          ParentEntry.Path = "WinNT:"
          For Each childEntry In ParentEntry.Children
              Select Case childEntry.SchemaClassName
                  Case "Domain"


                      SubParentEntry.Path = "WinNT://" & childEntry.Name
                      For Each SubChildEntry In SubParentEntry.Children

                          Select Case SubChildEntry.SchemaClassName
                              Case "Computer"
                                  LBox.Items.Add(SubChildEntry.Name)
                          End Select
                      Next

              End Select
          Next
      Catch Excep As Exception
          MsgBox("Error While Reading Directories")
      Finally
          ParentEntry = Nothing
      End Try


now i want to referesh this after a certain interval of time..please tel me how to do..

Thank you
Posted

1 solution

chek this link
http://www.vbdotnetforums.com/windows-forms/39160-listbox-items-do-not-refresh.html[^]

VB
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

ListBox1.Items.Add("First Item")
ListBox1.Items.Add("Second Item")
ListBox1.Items.Add("Third Item")
ListBox1.Items.Add("Fourth Item")
ListBox1.SelectedIndex = 0

Timer1.Interval = 500
Timer1.Start()

End Sub

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick

Dim i As Integer
i = ListBox1.SelectedIndex
i = i + 1
If i > ListBox1.Items.Count - 1 Then i = 0
ListBox1.SelectedIndex = i

End Sub
 
Share this answer
 
v2
Comments
OneInNineMillion 17-Jan-13 3:52am    
That link seems very helpful. The code doesn't seem to do what's suggested on the other forums though.
Darn ListBoxes, I would just avoid using them lol. Pro approach. Challenge Avoided!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900