473,383 Members | 1,922 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Progress bar cannot be shown while a process is running

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...

Oct 3 '07 #1
12 3076
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.

Oct 3 '07 #2
Armin,

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

:-)

Cor
Oct 4 '07 #3
"Cor Ligthert[MVP]" <no************@planet.nlschrieb
Armin,

Nice explanation
Thanks :)
and even without the so by me damned words "message
pump".
I'll put it in my synonym list. ;)
Armin
Oct 4 '07 #4
On Oct 4, 2:17 pm, "Armin Zingler" <az.nos...@freenet.dewrote:
"Cor Ligthert[MVP]" <notmyfirstn...@planet.nlschrieb
Armin,
Nice explanation

Thanks :)
and even without the so by me damned words "message
pump".

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

Armin
Mr. Zingler,
Thank you for your detailed answer.

Oct 4 '07 #5
Also, if i remove waitforexit(), main form can be interacted while the
external process is running without coding mutlithreading. So is the
unique way to set multi-threading to use waitforexit() effect and main
form interaction at the same same time with external process?

Oct 5 '07 #6
"kimiraikkonen" <ki*************@gmail.comschrieb
Also, if i remove waitforexit(), main form can be interacted while
the external process is running without coding mutlithreading.
Right
So is
the unique way to set multi-threading to use waitforexit() effect
and main form interaction at the same same time with external
process?
Sorry, I don't understand. If you want to wait for exit, you either can
handle the process' Exited event or you can call waitforexit in another
thread. For this purpose I'd prefer handling the Exit event.
Armin
Oct 5 '07 #7
On Oct 5, 12:52 pm, "Armin Zingler" <az.nos...@freenet.dewrote:
"kimiraikkonen" <kimiraikkone...@gmail.comschrieb
Also, if i remove waitforexit(), main form can be interacted while
the external process is running without coding mutlithreading.

Right
So is
the unique way to set multi-threading to use waitforexit() effect
and main form interaction at the same same time with external
process?

Sorry, I don't understand. If you want to wait for exit, you either can
handle the process' Exited event or you can call waitforexit in another
thread. For this purpose I'd prefer handling the Exit event.

Armin
Thanks Armin, so could you give a simple example about handle exit
event? Sorry for being newbie and glad to receive help from experts.

Thanks.

Oct 5 '07 #8
"kimiraikkonen" <ki*************@gmail.comschrieb
Thanks Armin, so could you give a simple example about handle exit
event? Sorry for being newbie and glad to receive help from experts.

Dim p As Process
'...
'start process
'...
AddHandler p.Exited, AddressOf OnProcessExited

Private Sub OnProcessExited( _
ByVal sender As Object, ByVal e As System.EventArgs)

MsgBox("exited")

End Sub
Armin
Oct 5 '07 #9
On Oct 5, 11:01 pm, "Armin Zingler" <az.nos...@freenet.dewrote:
"kimiraikkonen" <kimiraikkone...@gmail.comschrieb
Thanks Armin, so could you give a simple example about handle exit
event? Sorry for being newbie and glad to receive help from experts.

Dim p As Process
'...
'start process
'...
AddHandler p.Exited, AddressOf OnProcessExited

Private Sub OnProcessExited( _
ByVal sender As Object, ByVal e As System.EventArgs)

MsgBox("exited")

End Sub

Armin
Thanks but sorry, "OnProcessExited" cannot be found via intellisense.
I'm using vb.net 2005 express.

Oct 6 '07 #10
"kimiraikkonen" <ki*************@gmail.comschrieb
On Oct 5, 11:01 pm, "Armin Zingler" <az.nos...@freenet.dewrote:
"kimiraikkonen" <kimiraikkone...@gmail.comschrieb
Thanks Armin, so could you give a simple example about handle
exit event? Sorry for being newbie and glad to receive help from
experts.
Dim p As Process
'...
'start process
'...
AddHandler p.Exited, AddressOf OnProcessExited

Private Sub OnProcessExited( _
ByVal sender As Object, ByVal e As System.EventArgs)

MsgBox("exited")

End Sub

Armin

Thanks but sorry, "OnProcessExited" cannot be found via
intellisense. I'm using vb.net 2005 express.
?? It's right there below.
Armin
Oct 6 '07 #11
On Oct 6, 5:50 pm, "Armin Zingler" <az.nos...@freenet.dewrote:
"kimiraikkonen" <kimiraikkone...@gmail.comschrieb


On Oct 5, 11:01 pm, "Armin Zingler" <az.nos...@freenet.dewrote:
"kimiraikkonen" <kimiraikkone...@gmail.comschrieb
Thanks Armin, so could you give a simple example about handle
exit event? Sorry for being newbie and glad to receive help from
experts.
Dim p As Process
'...
'start process
'...
AddHandler p.Exited, AddressOf OnProcessExited
Private Sub OnProcessExited( _
ByVal sender As Object, ByVal e As System.EventArgs)
MsgBox("exited")
End Sub
Armin
Thanks but sorry, "OnProcessExited" cannot be found via
intellisense. I'm using vb.net 2005 express.

?? It's right there below.

Armin- Hide quoted text -

- Show quoted text -
There are a lot of intellisense listed OnXXXXX statements but there's
no "OnProcessExited" beleive. :(

Oct 6 '07 #12
On Sat, 06 Oct 2007 08:47:08 -0700, kimiraikkonen
<ki*************@gmail.comwrote:
>On Oct 6, 5:50 pm, "Armin Zingler" <az.nos...@freenet.dewrote:
>"kimiraikkonen" <kimiraikkone...@gmail.comschrieb


On Oct 5, 11:01 pm, "Armin Zingler" <az.nos...@freenet.dewrote:
"kimiraikkonen" <kimiraikkone...@gmail.comschrieb
Thanks Armin, so could you give a simple example about handle
exit event? Sorry for being newbie and glad to receive help from
experts.
Dim p As Process
'...
'start process
'...
AddHandler p.Exited, AddressOf OnProcessExited
Private Sub OnProcessExited( _
ByVal sender As Object, ByVal e As System.EventArgs)
MsgBox("exited")
End Sub
Armin
Thanks but sorry, "OnProcessExited" cannot be found via
intellisense. I'm using vb.net 2005 express.

?? It's right there below.

Armin- Hide quoted text -

- Show quoted text -

There are a lot of intellisense listed OnXXXXX statements but there's
no "OnProcessExited" beleive. :(
Look at the code Armin posted. OnProcessExited is defined in that
code.
Oct 6 '07 #13

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- ...
7
by: Pepi Tonas | last post by:
I have a form that takes some time to load because it has to populate some Data. I was trying to display a form on top of it with an activity bar so that user can see that something's going on. ...
1
by: Anonieko | last post by:
Query: How to display progress bar for long running page Answer: Yet another solution. REFERENCE: http://www.eggheadcafe.com/articles/20050108.asp My only regret is that when click the...
3
by: Ritesh Raj Sarraf | last post by:
Hi, I have a small application, written in Python, that uses threads. The application uses function foo() to download files from the web. As it reads data from the web server, it runs a progress...
1
by: daniel_xi | last post by:
Hi all, I am running a VS 2003 .NET project on my client machine (Win 2000 SP4, ..NET framework 1.1), running an ASP.NET application on a remote web server (Win 2000 Server, IIS 6.0, .NET...
5
by: Miro | last post by:
I will try my best to ask this question correctly. I think in the end the code will make more sence of what I am trying to accomplish. I am just not sure of what to search for on the net. I...
3
by: Tim Satterwhite | last post by:
Hi All, I think this is a thorny problem, and I'm hoping you can help. I've not found this exact issue described anywhere yet. I have a stored procedure that calls BULK INSERT on a set of...
7
by: kimiraikkonen | last post by:
Hello experts, I've been already working on a project and also asked and i've managed to create a basic Gmail mail sender, but i want to add a progressbar that shows "sending is in progress" but...
1
by: spinoza1111 | last post by:
I want the GUI of the spinoza system to not piss me off with the usual type of progress reporting one sees: the flashy, colorful, and utterly uninformative gizmos that go back and forth and round...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.