Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Showing a spinner while a Windows Forms program is "processing", similar to ajaxStart/ajaxStop?

Yes, yes. I know they are 2 completely different technologies. I recently moved over to FAT development with C# and Windows Forms from web development. I always thought it was very easy to show a spinner using ajaxStart and ajaxStop, so the user knows something is occurring and to continue waiting.

Is there an equivalently simple technique for C# Windows Forms that can be implement globally? For example, if I am querying a DB and waiting for some results, normally the program becomes unresponsive for a few seconds and then starts working again after "processing". Is there some global way I can display a spinner while my program is "processing" instead of identifying all possible points in the program that could cause it to become unresponsive and just ripping off new threads?

Please let me know if I am being unclear.

like image 457
bulltorious Avatar asked Jan 25 '12 17:01

bulltorious


People also ask

How do I use the ProgressBar in WinForms?

To create a ProgressBar control at design-time, you simply drag a ProgressBar control from the Toolbox and drop onto a Form in Visual Studio. After you the drag and drop, a ProgressBar is created on the Form; for example the ProgressBar1 is added to the form and looks as in Figure 1.

What is ProgressBar in UI Windows Forms?

A progress bar is a control that an application can use to indicate the progress of a lengthy operation such as calculating a complex result, downloading a large file from the Web etc.

Are Windows Forms good for games?

Writing games with a WinForms or WPF UI is perfectly fine. There are thousands upon thousands of popular and enjoyable games that don't need or benefit from hardware support. Just think, if nothing else, of the classic Windows games Minesweeper, Solitaire, or Freecell.


1 Answers

The standard Windows Forms way to do that is Cursor.Current = Cursors.WaitCursor;.

Does that work for you, or does it have to be an image?

like image 140
Blorgbeard Avatar answered Sep 23 '22 06:09

Blorgbeard