473,400 Members | 2,163 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,400 software developers and data experts.

Custom Progress Bar Show Dialog

I'm trying to build a custom progress bar that will run as some subs are
running in the background but when I open the custom form with the progress
bar on it using the showdialog, none of the subs run until the form is
closed but I need the form to be on top so the users can't click anywhere
else till the tasks are complete. How would I go about doing this? I need
to open this form, runs some subs, then close the form. Thanks
Nov 21 '05 #1
5 3228
* "B-Dog" <bd***@hotmail.com> scripsit:
I'm trying to build a custom progress bar that will run as some subs are
running in the background but when I open the custom form with the progress
bar on it using the showdialog, none of the subs run until the form is
closed but I need the form to be on top so the users can't click anywhere
else till the tasks are complete.


Multithreading:

<URL:http://msdn.microsoft.com/library/en-us/dnforms/html/winforms06112002.asp>
<URL:http://msdn.microsoft.com/library/en-us/dnforms/html/winforms08162002.asp>
<URL:http://msdn.microsoft.com/library/en-us/dnforms/html/winforms01232003.asp>

<URL:http://www.devx.com/dotnet/Article/11358/>

<URL:http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemWindowsFormsControlClassInvokeTopic.asp >

Multithreading in Visual Basic .NET (Visual Basic Language Concepts)
<URL:http://msdn.microsoft.com/library/en-us/vbcn7/html/vaconthreadinginvisualbasic.asp>

Sample:

<URL:http://dotnet.mvps.org/dotnet/samples/filesystem/downloads/FileSystemEnumerator.zip>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 21 '05 #2
Hmmn, I didn't know that was considered multithreading. Thanks for the
info, I'll check it out.

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
* "B-Dog" <bd***@hotmail.com> scripsit:
I'm trying to build a custom progress bar that will run as some subs are
running in the background but when I open the custom form with the progress bar on it using the showdialog, none of the subs run until the form is
closed but I need the form to be on top so the users can't click anywhere else till the tasks are complete.
Multithreading:

<URL:http://msdn.microsoft.com/library/en...orms06112002.a
sp> <URL:http://msdn.microsoft.com/library/en...orms08162002.a
sp> <URL:http://msdn.microsoft.com/library/en...orms01232003.a
sp>
<URL:http://www.devx.com/dotnet/Article/11358/>

<URL:http://msdn.microsoft.com/library/en...ystemWindowsFo
rmsControlClassInvokeTopic.asp>
Multithreading in Visual Basic .NET (Visual Basic Language Concepts)
<URL:http://msdn.microsoft.com/library/en...hreadinginvisu
albasic.asp>
Sample:

<URL:http://dotnet.mvps.org/dotnet/sample...s/FileSystemEn
umerator.zip>
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #3
I can't figure out these threads, I've read over this stuff and still don't
understand it. Could anyone help me with this below to try and fire my form
as dialog then run another sub then close dialog when complete. This is what
I started with

Dim f As New Progressx("your data is being exported")

f.ShowDialog()

ExportExcel()

f.Close()

I've tried this but of course I don't know what I'm doing, the form opens
and the process runs but the stuff on the new form doesn't work, I have a
timer on the form I'm opening with the show dialog and it doesn't stay
running

Dim f As New Progressx("your data is being exported")

Sub LaunchNight()

f.ShowDialog()

End Sub

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

Dim t As Thread = New Thread(AddressOf LaunchNight)

t.Start()

ExportExcel()

f.Close()

End Sub

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
* "B-Dog" <bd***@hotmail.com> scripsit:
I'm trying to build a custom progress bar that will run as some subs are
running in the background but when I open the custom form with the progress bar on it using the showdialog, none of the subs run until the form is
closed but I need the form to be on top so the users can't click anywhere else till the tasks are complete.
Multithreading:

<URL:http://msdn.microsoft.com/library/en...orms06112002.a
sp> <URL:http://msdn.microsoft.com/library/en...orms08162002.a
sp> <URL:http://msdn.microsoft.com/library/en...orms01232003.a
sp>
<URL:http://www.devx.com/dotnet/Article/11358/>

<URL:http://msdn.microsoft.com/library/en...ystemWindowsFo
rmsControlClassInvokeTopic.asp>
Multithreading in Visual Basic .NET (Visual Basic Language Concepts)
<URL:http://msdn.microsoft.com/library/en...hreadinginvisu
albasic.asp>
Sample:

<URL:http://dotnet.mvps.org/dotnet/sample...s/FileSystemEn
umerator.zip>
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #4
Here is the code on the form I'm trying to open while process long sub.
Essentially, I'm trying to have a small form open up that does the night
rider thing while we are waiting.

Dim Forward As Boolean = True

Dim x As Integer = 0

Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs)
Handles Timer1.Tick

If Forward Then

If x > 115 Then Forward = False

x += 1

Else

If x <= -9 Then Forward = True

x -= 1

End If

Me.imgProgress.Left = x

End Sub

"B-Dog" <bd***@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
I can't figure out these threads, I've read over this stuff and still don't understand it. Could anyone help me with this below to try and fire my form as dialog then run another sub then close dialog when complete. This is what I started with

Dim f As New Progressx("your data is being exported")

f.ShowDialog()

ExportExcel()

f.Close()

I've tried this but of course I don't know what I'm doing, the form opens
and the process runs but the stuff on the new form doesn't work, I have a
timer on the form I'm opening with the show dialog and it doesn't stay
running

Dim f As New Progressx("your data is being exported")

Sub LaunchNight()

f.ShowDialog()

End Sub

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

Dim t As Thread = New Thread(AddressOf LaunchNight)

t.Start()

ExportExcel()

f.Close()

End Sub

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
* "B-Dog" <bd***@hotmail.com> scripsit:
I'm trying to build a custom progress bar that will run as some subs are running in the background but when I open the custom form with the progress bar on it using the showdialog, none of the subs run until the form is
closed but I need the form to be on top so the users can't click anywhere else till the tasks are complete.
Multithreading:

<URL:http://msdn.microsoft.com/library/en...orms06112002.a sp>

<URL:http://msdn.microsoft.com/library/en...orms08162002.a sp>

<URL:http://msdn.microsoft.com/library/en...orms01232003.a sp>

<URL:http://www.devx.com/dotnet/Article/11358/>

<URL:http://msdn.microsoft.com/library/en...ystemWindowsFo rmsControlClassInvokeTopic.asp>

Multithreading in Visual Basic .NET (Visual Basic Language Concepts)

<URL:http://msdn.microsoft.com/library/en...hreadinginvisu albasic.asp>

Sample:

<URL:http://dotnet.mvps.org/dotnet/sample...s/FileSystemEn umerator.zip>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>


Nov 21 '05 #5
Well I got it working but don't know right, I was running thread on the
wrong form and ran processes on new form and it worked great.

Dim t As Thread = New Thread(AddressOf LaunchSub)

Dim Forward As Boolean = True

Dim x As Integer = 0

Sub LaunchSub()

main.ExportExcel()

Me.Close()

t.Abort()

End Sub

Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs)
Handles Timer1.Tick

If Forward Then

If x > 115 Then Forward = False

x += 1

Else

If x <= -9 Then Forward = True

x -= 1

End If

Me.imgProgress.Left = x

End Sub

Private Sub Progressx_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles MyBase.Load

t.Start()

End Sub

"B-Dog" <bd***@hotmail.com> wrote in message
news:eK**************@TK2MSFTNGP15.phx.gbl...
Here is the code on the form I'm trying to open while process long sub.
Essentially, I'm trying to have a small form open up that does the night
rider thing while we are waiting.

Dim Forward As Boolean = True

Dim x As Integer = 0

Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick

If Forward Then

If x > 115 Then Forward = False

x += 1

Else

If x <= -9 Then Forward = True

x -= 1

End If

Me.imgProgress.Left = x

End Sub

"B-Dog" <bd***@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
I can't figure out these threads, I've read over this stuff and still

don't
understand it. Could anyone help me with this below to try and fire my

form
as dialog then run another sub then close dialog when complete. This is

what
I started with

Dim f As New Progressx("your data is being exported")

f.ShowDialog()

ExportExcel()

f.Close()

I've tried this but of course I don't know what I'm doing, the form opens
and the process runs but the stuff on the new form doesn't work, I have a timer on the form I'm opening with the show dialog and it doesn't stay
running

Dim f As New Progressx("your data is being exported")

Sub LaunchNight()

f.ShowDialog()

End Sub

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

Dim t As Thread = New Thread(AddressOf LaunchNight)

t.Start()

ExportExcel()

f.Close()

End Sub

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
* "B-Dog" <bd***@hotmail.com> scripsit:
> I'm trying to build a custom progress bar that will run as some subs are > running in the background but when I open the custom form with the

progress
> bar on it using the showdialog, none of the subs run until the form is > closed but I need the form to be on top so the users can't click

anywhere
> else till the tasks are complete.

Multithreading:

<URL:http://msdn.microsoft.com/library/en...orms06112002.a sp>

<URL:http://msdn.microsoft.com/library/en...orms08162002.a
sp>

<URL:http://msdn.microsoft.com/library/en...orms01232003.a
sp>

<URL:http://www.devx.com/dotnet/Article/11358/>

<URL:http://msdn.microsoft.com/library/en...ystemWindowsFo
rmsControlClassInvokeTopic.asp>

Multithreading in Visual Basic .NET (Visual Basic Language Concepts)

<URL:http://msdn.microsoft.com/library/en...hreadinginvisu
albasic.asp>

Sample:

<URL:http://dotnet.mvps.org/dotnet/sample...s/FileSystemEn
umerator.zip>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>



Nov 21 '05 #6

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

Similar topics

2
by: Dennis C. Drumm | last post by:
This is a restatement of an earlier post that evidently wasn't clear. I am building a custom MessageBox dialog that has, among other things, a few new button options (yes to all, no to all, etc.)...
3
by: Gary O'Malley | last post by:
Everytime I download a file from the web I get a nice animated dialogue box that shows the size of the file, how much has been received and the approximate remaining time. It also gives the...
4
by: Alexander | last post by:
Hi, I have written a program that takes on some operations much more time than I expected. As I have seen users clicking wildly on the screen to make something happen, I want to follow the...
0
by: Ron Andersen | last post by:
I have C# custom actions and merge modules created in Visual Studio to install some components of the application I am working on. The merge modules are used with an Install Shield 9 project. ...
4
by: LhK-Soft | last post by:
Hi, I'm active in VC++ for several years now, so I know some things (I think). Using MS-Access I store a db with lots of entries and uses the VBA techniques to export those data to e.g. HTML, XML...
1
by: Dino M. Buljubasic | last post by:
I'd like to include a pop up progress bar in my application that would show the progress of AutoUpdate feature, searching, storing, etc in my application. Any simple code for this to share? ...
2
by: reshm | last post by:
In my application i have file save & file open button i use common dialog box to save the file but simultaneously i want to show progrss bar to show the progess. how can i do?
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: Lawyno | last post by:
Hi there :) Here are some infos about my "project": I have the "honor" to write some scripts (VBScript) for some application developed by another company. In this application there is limited...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.