Hey there, so basicly I'm writing a little application that will kill some processes and some junk programs running in the background. Yea i know this can be done in task manager aswell, but I want to learn ^^.
So, I want a button called "Get all running proccesses", when u click that button all processes should get added to a dropdown box, so the user can select the process in the dropdown menu. right now i got this command:
foreach (System.Diagnostics.Process p in System.Diagnostics.Process.GetProcessesByName(textBox1.Text))
{
try
{
p.Kill();
p.WaitForExit();
progressBar1.Value = 100;
label1.ForeColor = System.Drawing.Color.Green;
label1.Text = "Process Successfully Killed";
timer1.Start();
textBox1.ResetText();
}
catch (Win32Exception)
{
}
catch (InvalidOperationException)
{
}
it will kill the text entered in the textbox, so i just want to replace the text box with a dropdown menu :P, any thoughts on how i could do this?
Edit: also, is there any way i can make label1 it say "couldnt find process" or something similar if it could find the process? :)
Kind Regards
-Jazerix