Dim intIDX As Integer
Dim ServerList As ListOfServer
' Set MousePointer to Working Pointer
MousePointer = vbHourglass
' Clear the ListBox
lstComputers.Clear
' Get List of Computers on Network (Type All: Server and Workstation)
ServerList = EnumServer(SRV_TYPE_ALL)
' Loop through all the computers and add them to the listbox
If ServerList.Init Then
For intIDX = 1 To UBound(ServerList.List)
lstComputers.AddItem ServerList.List(intIDX).ServerName
Next
End If
1stComputer is the name of the listbox.How do i change the display to listview in order for me to change the colour of the item in it. I can display it in treeview but all the function such as right click pop up menu can't work. Please help....
Thanks alot for helping me. Yes i'm looking for the forecolor because i have to differentiate each different computer. I will try the suggestions you all gave me. Post agin the result after i have try it ok.
Sorry to hijack someone's thread, but when I tried to do this, I get a compile error with user defined type not defined error with the Public Sub line highlighted.
My reputation is in tatters. Don't bother trying to repair it.
Hmmm. Something funny going on. I just created a new project and it compiled ok. I'll get back to my form and do some checking.
Thanks for your time.
You might have a corrupt .vbp file that isn't picking up all of the standard references that are built into VB.
Try this:
Open up a new, standarrd exe, project. Remove the default Form1.
Add each form and module from your old project to this new project and run it. If the whole thing works, then your .vbp file was the problem. If so, just do a SaveAs on the project file, and overlay the old .vbp file.
(Incidentially, you would need to add any components or references to the new project file that the old one had as well as the forms and modules.)