473,386 Members | 1,860 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,386 software developers and data experts.

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 1779
You need to add some Application.DoEvents 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.DoEvents.
Otherwise the only code that gets a chance to run is the code that is loading
your form.

"be**********@gmail.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 InitializeComponent Sub of a form... so I
can't exactly put Application.DoEvents every 10 lines in
InitializeComponent.

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.Threading.Thread
t = New System.Threading.Thread(AddressOf progressThreadStart)
t.IsBackground = True
t.ApartmentState = Threading.ApartmentState.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
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...
2
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...
9
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...
9
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...
8
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?...
9
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...
2
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...
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...
10
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...
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...
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
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
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...
0
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...

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.