Public Class processSelect


    Private Sub processo_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.Focus()
        updatelist()
    End Sub

    Public Sub updatelist()
        Dim temp As Process()
        temp = Process.GetProcesses()
        Dim x As Integer
        For x = 0 To temp.Length - 1
            lstProcess.Items.Add(temp(x).ProcessName)
        Next
        lstProcess.SelectedItem = txtSelectProcess.Text
    End Sub

    Private Sub BtnUpgProcess_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnUpgProcess.Click
        lstProcess.Items.Clear()
        updatelist()
    End Sub

    Private Sub btnClose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClose.Click
        mainForm.rdbShutdown.Checked = True
        Me.Visible = False
    End Sub

    Private Sub ListBox1_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles lstProcess.DoubleClick
        btnSelez.PerformClick()
    End Sub

    Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lstProcess.SelectedIndexChanged
        txtSelectProcess.Text = lstProcess.SelectedItem
    End Sub


    Private Sub btnSelez_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSelez.Click
        mainForm.txtProcess.Text = txtSelectProcess.Text
        Me.Visible = False
    End Sub

    Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtSelectProcess.TextChanged
        If txtSelectProcess.Text <> "" Then
            btnSelez.Enabled = True
        End If
    End Sub
End Class