08-10-17, 02:04 AM
PHP كود :
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If ListViewEx1.CheckedItems.Count > 0 Then
ProgressBar1.Style = ProgressBarStyle.Continuous
ProgressBar1.Maximum = 1
ProgressBar1.Maximum = ListViewEx1.CheckedItems.Count
Dim thread As New Threading.Thread(AddressOf installation) With {.IsBackground = True}
thread.Start()
End If
End Sub
Sub installation()
Me.Invoke(Sub() Me.Enabled = False)
Dim items As String() = Nothing
ListViewEx1.Invoke(Sub()
items = ListViewEx1.CheckedItems.Cast(Of ListViewItem).Select(Function(x) x.Text).ToArray
End Sub)
For Each itm In items
ToolStripStatusLabel1.Text = itm
Process.Start(itm).WaitForExit()
ProgressBar1.Invoke(Sub() ProgressBar1.Increment(1))
Next
Me.Invoke(Sub() Me.Enabled = True)
ToolStripStatusLabel1.Text = "تم الانتهاء من تصطيب كل البرامج"
MsgBox("تم الانتهاء من تصطيب كل البرامج")
End Sub
