下面是我自己编写的程序代码段,进度条达到100%时无法退出程序;检查组合框中所选索引中是否有有效文件要运行之后。
Private Sub CheckIfRunning()
p = Process.GetProcessesByName(ComboBox1.SelectedIndex = TabIndex)
If p.Count > 0 Then
' Process is running
Else
Dim did_an_oopsie As DialogResult = Form3.ShowDialog
If did_an_oopsie = Form3.ProgressBar1.Value = 100 Then
Close()
End If
Try
Process.Start(System.IO.Path.Combine(
AppDomain.CurrentDomain.BaseDirectory,ComboBox1.SelectedIndex = TabIndex))
Catch ex As Exception
End Try
End If
End Sub