473,750 Members | 2,541 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Progress Bar Window Not Drawing

Hi,

I've tried a number of different things including the use of threads
and timers, but can't come up with the solution yet.

The issue is this: launch a window with an animation or progress bar
that changes. While this "progress window" is being animated, launch
the actual window. Finally close the "progress window".

The problem is, the "progress window" does not render the gui until the
second window is done loading.

Any links or hints are appreciated.

Thanks,

Sean.

Nov 21 '05 #1
3 1793
You need to add some Application.DoE vents calls into your load code for the
second window. All of this processing is occuring on a single thread of
execution. The timer events will not be received by the progress bar window
unless periodically you give up execution by calling Application.DoE vents.
Otherwise the only code that gets a chance to run is the code that is loading
your form.

"be**********@g mail.com" wrote:
Hi,

I've tried a number of different things including the use of threads
and timers, but can't come up with the solution yet.

The issue is this: launch a window with an animation or progress bar
that changes. While this "progress window" is being animated, launch
the actual window. Finally close the "progress window".

The problem is, the "progress window" does not render the gui until the
second window is done loading.

Any links or hints are appreciated.

Thanks,

Sean.

Nov 21 '05 #2
DoEvents does do the trick... but the problem is that the code blocking
the message queue is in the InitializeCompo nent Sub of a form... so I
can't exactly put Application.DoE vents every 10 lines in
InitializeCompo nent.

There must be an easy solution. Help anyone?

Thanks,

Sean

Nov 21 '05 #3
I found out what was wrong.

Creating a thread was the right way to go but some additional
properties of that thread had to be set.

This is what made it work:

Dim t As System.Threadin g.Thread
t = New System.Threadin g.Thread(Addres sOf progressThreadS tart)
t.IsBackground = True
t.ApartmentStat e = Threading.Apart mentState.STA
t.Start()

the IsBackground and ApartmentState lines did the trick.

Nov 21 '05 #4

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

Similar topics

13
2195
by: Martin Mrazek | last post by:
Hi, I check data validity in html form by JS. Something like for (i=0; i<document.form.elements.length; i++) { chechkValidity(i); } Unfortunately, the form has about two thousands elements (it is statistical questioning form for companies) and execution of this one cycle takes about twenty seconds.
2
2766
by: bob | last post by:
Hello, I want to show progress to the user while some method is running so I thought I'd use a progress bar. But I don't see how I can do this without writing GUI code in the model? In Smalltalk I would fire of notification exceptions that a progress bar would catch, increment progress, and then allow to continue (or no
9
13618
by: Popoxinhxan | last post by:
Dear experts, i want to develop an client application that consume the google search web service. In my MainForm i have a method to retrieve all the search result e.g. GetGoogleResults(). Now i want to have a nice progress bar in another form e.g ProgressForm to perform the search action. i tried to do it but the progress bar won't work and the GUI freezed. I knew how to do with the single threading but i don't know how to do it in...
9
1997
by: Martin Ho | last post by:
My application should check for new updates when user chooses this option in the menu. It should go online and check the flag and compare with current flag in the programs directory. If version is newer it should start download of the update file. This wouldn't be a problem, but how can I show the progress of the upgrade file which is being downloaded? I need to show this in percents.
8
5199
by: Brian Henry | last post by:
I created a smooth progress bar with this code.. but if you update the values in a row quickly of it and watch it on screen it flickers... how would i change this to reduce the flickering? thanks... Imports System Imports System.Drawing Imports System.Drawing.Drawing2D
9
3269
by: esakal | last post by:
Hello, I'm programming an application based on CAB infrastructure in the client side (c# .net 2005) Since my application must be sequencally, i wrote all the code in the UI thread. my problem occurs when i try to show a progress bar. The screen freezes. I know i'm not the first one to ask about it. but i'm looking
2
3567
by: Michael Jervis | last post by:
Hi, I'm writing a little application that scans a large number of media files for processing. The main application currently uses a backgroundworkerprocess to perform the scan. Each media file has meta data extracted and is added to one of a range of lists (pseudo-queues) for later processing. This is all fine. But, I want to provide more feedback to the end user as to progress as the process takes a considerable time.
1
4114
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 framework 1.1). The application implements a Progress Bar webcontrol, that pops up in a window, using the HttpHandler interface, on the event of a button click. The handler's process request routine reads the status of the progress by querying the...
10
2052
by: =?Utf-8?B?YXVsZGg=?= | last post by:
am having a hard time wrapping my head around "backgroundworker" class and updates to the window form that calls it. i have some questions about how to update windows form controls. i have multiple labels and i'm using a text box for status updates. the labels change when a task completes. the text box report what task is running. so 1) when i call _ProgressChange i need that function to passed the label i
0
8838
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
9583
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...
0
9396
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...
1
9342
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
9256
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...
1
6808
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
4888
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2807
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2226
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.