listview help :P

Do you need something made? then ask in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
2 posts Page 1 of 1
Contributors
User avatar
AleRi8
Top Poster
Top Poster
Posts: 153
Joined: Sun Sep 20, 2009 2:30 pm

listview help :P
AleRi8
hi i need help with how to use listview box so tht i can get a list of windows services using listbiew box like this

http://postimage.org/image/97jnjobzj/
check out my software
win7 itweaker basic £4.50
viewtopic.php?f=70&t=793
User avatar
mandai
Coding God
Coding God
Posts: 2585
Joined: Mon Apr 26, 2010 6:51 pm

Re: listview help :P
mandai
You can use this to list the services:
Code: Select all
Imports System.ServiceProcess ' .Net reference
Code: Select all
    Private Sub btnList_Click(sender As System.Object, e As System.EventArgs) Handles btnList.Click

        Dim services As ServiceController() = ServiceController.GetServices()
        For i As Integer = 0 To services.Length - 1

            Dim lvi As ListViewItem = New ListViewItem()
            lvi.Text = services(i).DisplayName

            lvi.SubItems.Add(services(i).ServiceName)
            lvi.SubItems.Add(services(i).Status.ToString())

            ListView1.Items.Add(lvi)

        Next
    End Sub
2 posts Page 1 of 1
Return to “Tutorial Requests”