进程运行时无法显示进度条 [英] Progress bar cannot be shown while a process is running

查看:114
本文介绍了进程运行时无法显示进度条的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

进度条有问题;虽然

" progressbar1.visible = True"出现在我看不见的

" progressbar1"单击button1时可以看到控制,在执行我的外部进程
之前,它会在外部

进程完成处理后出现。并且我的主要和唯一的形式(form1)不能在外部进程处理时进行交互。我怎么能摆脱

呢?


这是代码:


Private Sub Button1_Click_1(ByVal sender As System.Object,ByVal e As

System.EventArgs)处理Button1.Click


progressbar1.visible = True


Dim psInfo As New System.Diagnostics.ProcessStartInfo(" c:\ blabla.exe)

psInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Normal

Dim myProcess As Process = System.Diagnostics.Process.Start(psInfo)

myProcess.WaitForExit()

MsgBox(成功完成,MsgBoxStyle.Information,

完成)


结束子

谢谢和问候......

Hi there,
There is a problem about progress bar; although the
"progressbar1.visible = True" is present for my invisible
"progressbar1" control to make visible when button1 is clicked, before
execution of my external process, it appears after the external
process finishes processing. And my main and only form (form1) cannot
be interacted while external process is processing. How can i get rid
of it?

Here is the code:

Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

progressbar1.visible = True

Dim psInfo As New System.Diagnostics.ProcessStartInfo("c:\blabla.exe )
psInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Normal
Dim myProcess As Process = System.Diagnostics.Process.Start(psInfo)
myProcess.WaitForExit()
MsgBox(" Completed Successfully", MsgBoxStyle.Information,
"Completed")

End Sub
Thanks and regards...

推荐答案

另外,请注意:处理期间blabla.exe的成本为%100 CPU。可能是

原因吗?


无论如何我试过用%40-50 cpu-cost的外部应用程序用

类似的否定结果。当外部进程正在运行时,主要的

VB表单已损坏并在视觉上失真,因为外观并且您在外部进程运行期间无法单击或修改主表单。

Also, note: blabla.exe costs %100 CPU during processing. Could it be
the reason?

Anyway i tried with %40-50 cpu-costing external application with
similar negative result. While external process is running, the main
VB form is corrupted and distorted visually, as appearence and you
cannot click or modify main form during external process runs.


Armin,


很好的解释,即使没有我这么诅咒的话消息泵。


:-)

Cor
Armin,

Nice explanation and even without the so by me damned words "message pump".

:-)

Cor


" Cor Ligthert [MVP]" < no ************ @ planet.nlschrieb
"Cor Ligthert[MVP]" <no************@planet.nlschrieb

Armin,


Nice解释
Armin,

Nice explanation



谢谢:)

Thanks :)


甚至没有我这么诅咒的话语message

pump。
and even without the so by me damned words "message
pump".



我会把它放在同义词列表中。 ;)

Armin

I''ll put it in my synonym list. ;)
Armin


这篇关于进程运行时无法显示进度条的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆