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

Busy Indicator

Hi Experts

I have a C# Windows application where sometimes it can take upto 20 seconds
to switch between different forms. At the moment I show a 'Processing, please
wait' dialog while the next form is loading.

Using the background worker, I've tried including progressbars and other
custom busy indicators on the dialog. These all work in a jerky kind of way,
ie their motion is not smooth.

What is the best way to show some sort of busy indicator that runs smoothly
while other processing is happening? I've heard of animated gifs but cannot
find a good example.

Many thanks
Feb 23 '07 #1
4 19847
"jez123456" <je*******@discussions.microsoft.comwrote in message
news:47**********************************@microsof t.com...
Hi Experts

I have a C# Windows application where sometimes it can take upto 20 seconds
to switch between different forms. At the moment I show a 'Processing, please
wait' dialog while the next form is loading.

Using the background worker, I've tried including progressbars and other
custom busy indicators on the dialog. These all work in a jerky kind of way,
ie their motion is not smooth.

What is the best way to show some sort of busy indicator that runs smoothly
while other processing is happening? I've heard of animated gifs but cannot
find a good example.

Many thanks
What kind of processing are you talking about, and on what thread is this processing going
on?

Wily.

Feb 23 '07 #2
I can't help with the progress bar but as for the animated gif - I think
all you would have to do is display it when your app starts switching
forms and then stop displaying it when the app is finished and ready to
show the other form. If you can't find a suitable gif, you can make one
with any of the gif animating software out there (or modify one that you
found). There would be no need to code it, if that is what you mean by,
"cannot find a good example."

If you decide to go the animated gif route, and need help making or
modifying one, let me know. I occasionally have time for misc. little
projects and wouldn't mind lending a hand (absolutely free of charge and
under no conditions, of course). My only condition is that you not be
in too big of a hurry. I can't guarantee when/how much free time I
have.

*** Sent via Developersdex http://www.developersdex.com ***
Feb 23 '07 #3
If you are using .NET 2.0. I would recommend displaying a progress bar and
if you set the Style to Marquee, you don't have to do any threads. When the
progress bar is display and the style is set to Marquee, it does an
automatic scroll.

Eric Renken
"jez123456" <je*******@discussions.microsoft.comwrote in message
news:47**********************************@microsof t.com...
Hi Experts

I have a C# Windows application where sometimes it can take upto 20
seconds
to switch between different forms. At the moment I show a 'Processing,
please
wait' dialog while the next form is loading.

Using the background worker, I've tried including progressbars and other
custom busy indicators on the dialog. These all work in a jerky kind of
way,
ie their motion is not smooth.

What is the best way to show some sort of busy indicator that runs
smoothly
while other processing is happening? I've heard of animated gifs but
cannot
find a good example.

Many thanks

Feb 23 '07 #4
Many thanks for the advice. I am using .net 2.0 and have tried the Marquee
style but it only moves just before another form loads.

Here is my test code. It's a basic windows form project with a picturebox
and button controls. The picturebox image points to the office j0234687.gif.
When I click the button I was hoping the animation would run all the time,
but it seems to stop and start. Would an animated icon such as the smileys
work? I only need something very basic to show processing is going on. Thanks
again.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Threading;
namespace Animator
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void btnButton_Click(object sender, EventArgs e)
{
this.myImageControl.Visible = true;
MyClass proc = new MyClass(this.ProcessReady);
ThreadPool.QueueUserWorkItem(proc.LongProcess);
CheckForIllegalCrossThreadCalls = false;
}
private void ProcessReady(object sender, EventArgs e)
{
CheckForIllegalCrossThreadCalls = true;
}
class MyClass
{
private ManualResetEvent handle;
public event EventHandler Ready;
public MyClass(EventHandler method)
{
this.handle = new ManualResetEvent(false);
this.Ready += method;
}
public void LongProcess(object stateInfo)
{
handle.Set();
if (Ready != null)
Ready(this, new EventArgs());
}
}

}
}
Feb 26 '07 #5

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

Similar topics

10
by: Koen Janssens | last post by:
Can anybody give me an example on how to write a progress indicator in C++ using the standard library cerr or cout? My problem is I do not know how reset the output stream to the beginning of...
5
by: eskwayrd | last post by:
Hi group, I'm trying to add a busy indicator to the sorttable.js code available at: http://www.kryogenix.org/code/browser/sorttable/ (Actually, my version is modified for my needs, such as...
7
by: Andrew | last post by:
Hello, Is it possible for a file position indicator of an input stream to be greater than the size of a file? And if so could this cause fgetc to somehow write to the file? For example is it...
4
by: Paul | last post by:
Just wondering if there is a way to set up a web application where the curser turns into an hour glass when the application is busy, for example processing a stored procedure on a server that takes...
2
by: Paul Bromley | last post by:
Can someone give me a pointer of the best way to show that an application is busy and has not locked up? I am writing a utility to search a network drive for a number of tiff files. I will...
1
by: Marko Vuksanovic | last post by:
I am trying to implement a file upload progress indicator (doesn't have to be a progress bar) using atlas... I do realize that the indicator cannot be implemented using Update panel control, but is...
14
by: Frank Swarbrick | last post by:
A few weeks ago I had posed a question about how one my create a cursor for a query where the predicate condition is dynamic. Meaning that the query might want to have one of several possible...
0
by: rnaimon | last post by:
I found the following information on this site, but I am unable to get it to work. All it brings back is the xml page with no data. I am running a Windows 2003 Server with Exchange 2003 Server. ...
80
by: nicolas.sitbon | last post by:
Hi everybody, in a french C book, the author says that only {fgetc, getc, getchar, fgetwc, getwc, getwchar, fgets, gets, fgetws, getws, fputc, putc, putchar, fputwc, putwc, putwchar, fputs, puts,...
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: 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
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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
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.