473,750 Members | 6,487 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 10704
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
3390
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
6476
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
4272
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
11305
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
1678
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
12617
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
2433
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
2685
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
2337
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
8841
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
9401
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9260
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
8267
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...
0
6086
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();...
0
4718
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3328
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2812
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2229
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.