[Tutorial] How to make a task manager

Heres your chance to share your own tutorials with the community. Just post them on here. If your lucky they may even be posted on the main site.
2 posts Page 1 of 1
Contributors
User avatar
deathninjako
Just Registered
Just Registered
Posts: 4
Joined: Fri Nov 27, 2009 7:47 pm

Credits go to my friend bombsaway707 for showing me how to.

First add A status strip, then add a Toolstripstatuslabel1 and for its text put "processes: 0"
Then add a list view. Under the listview properties go to view then select details.
Then under listview properties go to Gridlines and select true
Now go to columns and add 5 columns they should look like this in this order
Image
After thats done double click the form and put:
Code: Select all
Dim Process As New Process()
Dim Count As Integer = 0
ListView1.Items.Clear()
For Each Process In Process.GetProcesses(My.Computer.Name)
On Error Resume Next
ListView1.Items.Add(Process.ProcessName)
ListView1.Items(Count).SubItems.Add(FormatNumber(Math.Round(Process.PrivateMemorySize64 / 1024), 0))
ListView1.Items(Count).SubItems.Add(Process.Responding)
ListView1.Items(Count).SubItems.Add(Process.StartTime.ToString.Trim)
ListView1.Items(Count).SubItems.Add(Process.Id)
Count += 1
Next
ToolStripStatusLabel1.Text = "Processes: " & ListView1.Items.Count
After that is done add in a button. Double click the button and put:
Code: Select all
For Each Process As ListViewItem In ListView1.SelectedItems
System.Diagnostics.Process.GetProcessById(Process.SubItems(4).Text).Kill()
Next
Form1_Load(Nothing, Nothing)
^make the button text "Kill Process"^
Now add a timer and under the timer put:
Code: Select all
Form1_Load(Nothing, Nothing) 
Now debug and it should work.
His Final Result:
Image
He didn't tell me the code for the refresh, but I figured it out.
Code: Select all
ListView1.Refresh()
User avatar
MasterCoding
Top Poster
Top Poster
Posts: 156
Joined: Sat Oct 24, 2009 4:26 pm

Please move this to my creation tutorials (vb.net)please because this is not source but a tutorial
2 posts Page 1 of 1
Return to “Tutorials”