473,832 Members | 2,136 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Marquee Style ProgressBar

JB
Hi All,

I have a Windows Form application that shows a "please wait" form
while I query a database for various information.
I display my form using Show, then run my DB query, then Close the
form at the end.

To make it look even nicer I placed a marquee style Progress Bar on my
form.
It works exactly the same way, but the marquee style progress bar
doesn't move at all while I'm running my DB query, which defeats the
purpose. If I don't close my form straight away after my DB query
returns, the progress bar starts moving.

It looks like the DB query thread is taking over the UI threadand
preventing my progress bar to move. However I was under the (naive)
impression that a marquee style progress bar was "thread independent"
and capable of moving as soon as displayed on a form (almost like an
animated Gif). Can somebody tell me if I can get the progress bar to
move while running the DB query without having to run the DB query in
a different thread.

Thanks
JB
Jun 27 '08 #1
6 10712
JB
On 2 Jun, 17:19, JB <jb.bross...@gm ail.comwrote:
Hi All,

I have a Windows Form application that shows a "please wait" form
while I query a database for various information.
I display my form using Show, then run my DB query, then Close the
form at the end.

To make it look even nicer I placed a marquee style Progress Bar on my
form.
It works exactly the same way, but the marquee style progress bar
doesn't move at all while I'm running my DB query, which defeats the
purpose. If I don't close my form straight away after my DB query
returns, the progress bar starts moving.

It looks like the DB query thread is taking over the UI threadand
preventing my progress bar to move. However I was under the (naive)
impression that a marquee style progress bar was "thread independent"
and capable of moving as soon as displayed on a form (almost like an
animated Gif). Can somebody tell me if I can get the progress bar to
move while running the DB query without having to run the DB query in
a different thread.

Thanks
JB
Jun 27 '08 #2
"JB" <jb*********@gm ail.comschrieb:
I have a Windows Form application that shows a "please wait" form
while I query a database for various information.
I display my form using Show, then run my DB query, then Close the
form at the end.

To make it look even nicer I placed a marquee style Progress Bar on my
form.
It works exactly the same way, but the marquee style progress bar
doesn't move at all while I'm running my DB query, which defeats the
purpose. If I don't close my form straight away after my DB query
returns, the progress bar starts moving.

It looks like the DB query thread is taking over the UI threadand
preventing my progress bar to move. However I was under the (naive)
impression that a marquee style progress bar was "thread independent"
and capable of moving as soon as displayed on a form (almost like an
animated Gif). Can somebody tell me if I can get the progress bar to
move while running the DB query without having to run the DB query in
a different thread.
I suggest to perform the query in the background thread. It's never a good
idea to block the main UI thread because this will prevent user interaction
(closing forms, etc.).

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

Jun 27 '08 #3
On Mon, 2 Jun 2008 09:19:05 -0700 (PDT), JB <jb*********@gm ail.com>
wrote:
>Hi All,

I have a Windows Form application that shows a "please wait" form
while I query a database for various information.
I display my form using Show, then run my DB query, then Close the
form at the end.

To make it look even nicer I placed a marquee style Progress Bar on my
form.
It works exactly the same way, but the marquee style progress bar
doesn't move at all while I'm running my DB query, which defeats the
purpose. If I don't close my form straight away after my DB query
returns, the progress bar starts moving.

It looks like the DB query thread is taking over the UI threadand
preventing my progress bar to move. However I was under the (naive)
impression that a marquee style progress bar was "thread independent"
and capable of moving as soon as displayed on a form (almost like an
animated Gif). Can somebody tell me if I can get the progress bar to
move while running the DB query without having to run the DB query in
a different thread.

Thanks
JB
Unless you explicitly create another thread to do the DB query, it
runs on the UI thread. Likewise the ProgressBar, being a UI control,
runs totally in the UI thread.

To keep the ProgressBar running you need to run the DB query on
another thread. BackgroundWorke r works well for this kind of
operation.
Jun 27 '08 #4
On Jun 2, 7:19 pm, JB <jb.bross...@gm ail.comwrote:
Hi All,

I have a Windows Form application that shows a "please wait" form
while I query a database for various information.
I display my form using Show, then run my DB query, then Close the
form at the end.

To make it look even nicer I placed a marquee style Progress Bar on my
form.
It works exactly the same way, but the marquee style progress bar
doesn't move at all while I'm running my DB query, which defeats the
purpose. If I don't close my form straight away after my DB query
returns, the progress bar starts moving.

It looks like the DB query thread is taking over the UI threadand
preventing my progress bar to move. However I was under the (naive)
impression that a marquee style progress bar was "thread independent"
and capable of moving as soon as displayed on a form (almost like an
animated Gif). Can somebody tell me if I can get the progress bar to
move while running the DB query without having to run the DB query in
a different thread.

Thanks
JB
While querying the DB, probably your UI thread is being blocked,
that's why you need to use BackgroundWorke r component to show progress
bar marquee animation during the operation asyncronusly.

Thanks,

Onur Güzel
Jun 27 '08 #5
Try Using BackgroundWorke r Component.:

Private Sub LoginBtn_Click( ByVal sender As System.Object, ByVal e
As System.EventArg s) Handles LoginBtn.Click
ProgressBar.Sty le = ProgressBarStyl e.Marquee
BackWorker.RunW orkerAsync()
End Sub

Private Sub BackWorker_DoWo rk(ByVal sender As System.Object, ByVal
e As System.Componen tModel.DoWorkEv entArgs) Handles BackWorker.DoWo rk

doConnect()

End Sub

Private Sub BackWorker_RunW orkerCompleted( ByVal sender As Object,
ByVal e As System.Componen tModel.RunWorke rCompletedEvent Args) Handles
BackWorker.RunW orkerCompleted
ProgressBar.Sty le = ProgressBarStyl e.Blocks
If Koneksi.StatusK oneksi = "Terkoneksi " Then Connected()
End Sub

Jun 27 '08 #6
JB
Hi All,

Thanks for all your suggestions.
I did implement a BackgroundWorde r solution and it wasn't that
complicated after all.

JB

davidkurniawan wrote:
Try Using BackgroundWorke r Component.:

Private Sub LoginBtn_Click( ByVal sender As System.Object, ByVal e
As System.EventArg s) Handles LoginBtn.Click
ProgressBar.Sty le = ProgressBarStyl e.Marquee
BackWorker.RunW orkerAsync()
End Sub

Private Sub BackWorker_DoWo rk(ByVal sender As System.Object, ByVal
e As System.Componen tModel.DoWorkEv entArgs) Handles BackWorker.DoWo rk

doConnect()

End Sub

Private Sub BackWorker_RunW orkerCompleted( ByVal sender As Object,
ByVal e As System.Componen tModel.RunWorke rCompletedEvent Args) Handles
BackWorker.RunW orkerCompleted
ProgressBar.Sty le = ProgressBarStyl e.Blocks
If Koneksi.StatusK oneksi = "Terkoneksi " Then Connected()
End Sub
Jun 27 '08 #7

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

Similar topics

2
3395
by: Jo_Calico | last post by:
I love the Dynamic Drive cross browser marquee script. I'd like to make the text loop immediately after completion, so the beginning runs right after the end (does that make sense?). Could anyone tell me how to do this? Here's the link: http://www.calicosystems.com/pilla/index1.htm Here's the code: <script language="JavaScript1.2">
1
6483
by: Sketcher | last post by:
Hi all, I am looking to add the following scrolling marquee to my website (see code below) However instead of using the marquee methods I want to use and as a person rests their mouse on either word the list will scroll accordingly. I do not want the text to scroll continously - it should only operate when the Up | Down feature is used.
2
4281
by: P2P | last post by:
Hi I am wondering if someone can help me here with the "perfect" marquee vertical scrolling script I've found. This marquee is great for me as it will call an external html page. This allow me to design a html page and update just that page without having to muck around on coding with the main page. There is one thing I like to have this marquee script able to do for me.
4
11308
by: uwe.braunholz | last post by:
Hello, I want to set the text of a marqee dynamical. So I created the following code: ****snip**** <style> #noticeMarquee { background-color:#ff00ff; color:#ffffff;
0
1682
by: =?Utf-8?B?d2luZHNpbQ==?= | last post by:
Hi, I have a c# program that needs to show the progressbar which is circular processbar,just like the one when windows xp loading. I tried below: private void TimeConsumingOperation(BackgroundWorker bw) { int percentComplete...; //???is it right /*Do something--time consuming work*/
8
12627
praclarush
by: praclarush | last post by:
Ok, I'm new to JavaScript and I'm taking a class for it the assignment in it I'm supposed to create edit a pre-made page to display a marquee that automatically scrolls for the user, as well as give an option to start, stop and reset the marquee. Now I have most of this done already, what I'm having problems with is that when i start the marquee it moves to the right, but i need to have it move from the bottom, upwards. heres my code (I'm not...
3
2441
by: joslyn | last post by:
1) Can anyone help me solve this problem by slowing the marquee text? 2) How to stop the marquee text when the mouse over it? Below are the following codes need to be solved: <table style="background:#000000 url();top:152px;left:0px;width:280px;height:10px;border:0px"> <tr><td valign="top"> <marquee direction=up scrollAmount=0scrollDelay=0 style="filter:wave(add=0,phase=1,freq=2,strength=38);height:200px"> <center>
1
2691
by: ced69 | last post by:
having trouble getting marquee to work get object required errors tring t <title>This Month at the Chamberlain Civic Center</title> <link href="styles.css" rel="stylesheet" type="text/css" /> <script src="Dunbarlab9.js" type="text/javascript"></script> <script type="text/javascript">
3
2342
by: Rajneesh Chellapilla | last post by:
Hi I made this marquee program however, I am having trouble getting all four marquees to line up correctly. Basically I want the the 4 marquees to line up on the four sides exactly so they intersect. Three of them look good. With fourth the marquee does something funny this is illustrated if you change the border color of the "up" marquee in the program. Help and insights would be appreciated. Here is the program, it is computationally...
0
9642
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10780
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10540
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10212
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9319
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7753
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6951
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
3970
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3077
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.