PC Review


Reply
Thread Tools Rate Thread

Busy Indicator

 
 
=?Utf-8?B?amV6MTIzNDU2?=
Guest
Posts: n/a
 
      23rd Feb 2007
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
 
Reply With Quote
 
 
 
 
Willy Denoyette [MVP]
Guest
Posts: n/a
 
      23rd Feb 2007
"jez123456" <(E-Mail Removed)> wrote in message
news:475AB593-78FE-4DA8-8C14-(E-Mail Removed)...
> 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.



 
Reply With Quote
 
Ted E.
Guest
Posts: n/a
 
      23rd Feb 2007
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 ***
 
Reply With Quote
 
Eric Renken
Guest
Posts: n/a
 
      23rd Feb 2007
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" <(E-Mail Removed)> wrote in message
news:475AB593-78FE-4DA8-8C14-(E-Mail Removed)...
> 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



 
Reply With Quote
 
=?Utf-8?B?amV6MTIzNDU2?=
Guest
Posts: n/a
 
      26th Feb 2007
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());
}
}

}
}


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Tentative always shows up as Busy when publishing Free/Busy to a file share ralfthewise Microsoft Outlook Calendar 0 25th Sep 2007 11:17 PM
offline files indicator and shortcut indicator =?Utf-8?B?Um9iZXJ0IFByZW11xb4=?= Windows XP Customization 1 10th Jul 2007 04:50 PM
offline files indicator and shortcut indicator =?Utf-8?B?Um9iZXJ0IFByZW11xb4=?= Windows XP General 1 10th Jul 2007 04:50 PM
offline files indicator and shortcut indicator =?Utf-8?B?Um9iZXJ0IFByZW11xb4=?= Windows Vista General Discussion 1 10th Jul 2007 04:50 PM
IE 6 web page surfing indicator or activity indicator =?Utf-8?B?a25lZWR0b25vc2U=?= Windows XP Internet Explorer 1 5th Nov 2006 01:57 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:30 PM.