I have a form which performs some asynchronous code. I want to display a
wait cursor when it starts, and hide the wait cursor when it has completed.
This part works fairly well, using:

this.TopLevelControl.Cursor = System.Windows.Forms.Cursors.WaitCursor;

I also want to prevent user interaction with the controls on my form while
the wait cursor is displayed, so that use events (except resize and cancel)
are blocked. What is the recommended way of doing this in .NET?

Thanks,
Aaron Queenan.

Re: Preventing user interaction while showing a "wait" cursor by Jan

Jan
Thu Jan 22 10:43:43 CST 2004

You can set the Enabled property of a control or even a form to false. This
will prevent any user interaction.

--
Greetz,
Jan
__________________________________
Read my weblog: http://weblogs.asp.net/jan
"Aaron Queenan" <aqueenan_DieSpammerDie_@contingent.com.au> schreef in
bericht news:OhkmWXQ4DHA.1804@TK2MSFTNGP12.phx.gbl...
> I have a form which performs some asynchronous code. I want to display a
> wait cursor when it starts, and hide the wait cursor when it has
completed.
> This part works fairly well, using:
>
> this.TopLevelControl.Cursor = System.Windows.Forms.Cursors.WaitCursor;
>
> I also want to prevent user interaction with the controls on my form while
> the wait cursor is displayed, so that use events (except resize and
cancel)
> are blocked. What is the recommended way of doing this in .NET?
>
> Thanks,
> Aaron Queenan.
>
>



Re: Preventing user interaction while showing a "wait" cursor by Aaron

Aaron
Thu Jan 22 10:48:27 CST 2004

Unfortunately, it will also change the background colour to grey, does some
wierd colouring of ListView controls which have items in, and inconsistently
disables scrollbars depending upon where they are and who owns them. :-(

Is there any way I can disable the user interaction _without_ setting the
Enabled property to false?

Thanks,
Aaron.

"Jan Tielens" <jan@no.spam.please.leadit.be> wrote in message
news:OtyjkbQ4DHA.1868@TK2MSFTNGP10.phx.gbl...
> You can set the Enabled property of a control or even a form to false.
This
> will prevent any user interaction.
>
> --
> Greetz,
> Jan
> __________________________________
> Read my weblog: http://weblogs.asp.net/jan
> "Aaron Queenan" <aqueenan_DieSpammerDie_@contingent.com.au> schreef in
> bericht news:OhkmWXQ4DHA.1804@TK2MSFTNGP12.phx.gbl...
> > I have a form which performs some asynchronous code. I want to display
a
> > wait cursor when it starts, and hide the wait cursor when it has
> completed.
> > This part works fairly well, using:
> >
> > this.TopLevelControl.Cursor =
System.Windows.Forms.Cursors.WaitCursor;
> >
> > I also want to prevent user interaction with the controls on my form
while
> > the wait cursor is displayed, so that use events (except resize and
> cancel)
> > are blocked. What is the recommended way of doing this in .NET?
> >
> > Thanks,
> > Aaron Queenan.
> >
> >
>
>



Re: Preventing user interaction while showing a "wait" cursor by hirf-spam-me-here

hirf-spam-me-here
Thu Jan 22 10:48:02 CST 2004

* "Aaron Queenan" <aqueenan_DieSpammerDie_@contingent.com.au> scripsit:
> I have a form which performs some asynchronous code. I want to display a
> wait cursor when it starts, and hide the wait cursor when it has completed.
> This part works fairly well, using:
>
> this.TopLevelControl.Cursor = System.Windows.Forms.Cursors.WaitCursor;
>
> I also want to prevent user interaction with the controls on my form while
> the wait cursor is displayed, so that use events (except resize and cancel)
> are blocked. What is the recommended way of doing this in .NET?

Disable the controls...

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>

Re: Preventing user interaction while showing a "wait" cursor by Nicholas

Nicholas
Thu Jan 22 10:52:50 CST 2004

Aaron,

You could override WndProc, and just toss out most of the messages that
come into the window. Of course, you would have a property that would turn
on and shut off this behavior. You will probably want to still handle
WM_PAINT messages, at the least.

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mvp@spam.guard.caspershouse.com

"Aaron Queenan" <aqueenan_DieSpammerDie_@contingent.com.au> wrote in message
news:uHNxPeQ4DHA.2404@TK2MSFTNGP10.phx.gbl...
> Unfortunately, it will also change the background colour to grey, does
some
> wierd colouring of ListView controls which have items in, and
inconsistently
> disables scrollbars depending upon where they are and who owns them. :-(
>
> Is there any way I can disable the user interaction _without_ setting the
> Enabled property to false?
>
> Thanks,
> Aaron.
>
> "Jan Tielens" <jan@no.spam.please.leadit.be> wrote in message
> news:OtyjkbQ4DHA.1868@TK2MSFTNGP10.phx.gbl...
> > You can set the Enabled property of a control or even a form to false.
> This
> > will prevent any user interaction.
> >
> > --
> > Greetz,
> > Jan
> > __________________________________
> > Read my weblog: http://weblogs.asp.net/jan
> > "Aaron Queenan" <aqueenan_DieSpammerDie_@contingent.com.au> schreef in
> > bericht news:OhkmWXQ4DHA.1804@TK2MSFTNGP12.phx.gbl...
> > > I have a form which performs some asynchronous code. I want to
display
> a
> > > wait cursor when it starts, and hide the wait cursor when it has
> > completed.
> > > This part works fairly well, using:
> > >
> > > this.TopLevelControl.Cursor =
> System.Windows.Forms.Cursors.WaitCursor;
> > >
> > > I also want to prevent user interaction with the controls on my form
> while
> > > the wait cursor is displayed, so that use events (except resize and
> > cancel)
> > > are blocked. What is the recommended way of doing this in .NET?
> > >
> > > Thanks,
> > > Aaron Queenan.
> > >
> > >
> >
> >
>
>



Re: Preventing user interaction while showing a "wait" cursor by Justin

Justin
Fri Jan 23 23:32:02 CST 2004

Easier than disabling the controls is displaying a dialog over top of the
form...

http://weblogs.asp.net/justin_rogers/archive/2004/01/22/61564.aspx

The above code demonstrates the display of a transparent *gamma* form that makes
the controls darker and intercepts any mouse/keyboard input while the form is
*busy* or in the case I posted *sleeping*.


--
Justin Rogers
DigiTec Web Consultants, LLC.
Blog: http://weblogs.asp.net/justin_rogers

"Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message
news:ufHS4gQ4DHA.2432@TK2MSFTNGP09.phx.gbl...
> * "Aaron Queenan" <aqueenan_DieSpammerDie_@contingent.com.au> scripsit:
> > I have a form which performs some asynchronous code. I want to display a
> > wait cursor when it starts, and hide the wait cursor when it has completed.
> > This part works fairly well, using:
> >
> > this.TopLevelControl.Cursor = System.Windows.Forms.Cursors.WaitCursor;
> >
> > I also want to prevent user interaction with the controls on my form while
> > the wait cursor is displayed, so that use events (except resize and cancel)
> > are blocked. What is the recommended way of doing this in .NET?
>
> Disable the controls...
>
> --
> Herfried K. Wagner [MVP]
> <http://www.mvps.org/dotnet>



Re: Preventing user interaction while showing a "wait" cursor by >

>
Sat Jan 24 04:32:39 CST 2004

this.Enabled = false,

Everytime I do a modal dialog box I do this because its highlighting the
modal box thats centered on the parent. Less visual clutter.


"Justin Rogers" <Justin@games4dotnet.com> wrote in message
news:ObLDrsj4DHA.2168@TK2MSFTNGP12.phx.gbl...
> Easier than disabling the controls is displaying a dialog over top of the
> form...
>
> http://weblogs.asp.net/justin_rogers/archive/2004/01/22/61564.aspx
>
> The above code demonstrates the display of a transparent *gamma* form that
makes
> the controls darker and intercepts any mouse/keyboard input while the form
is
> *busy* or in the case I posted *sleeping*.
>
>
> --
> Justin Rogers
> DigiTec Web Consultants, LLC.
> Blog: http://weblogs.asp.net/justin_rogers
>
> "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message
> news:ufHS4gQ4DHA.2432@TK2MSFTNGP09.phx.gbl...
> > * "Aaron Queenan" <aqueenan_DieSpammerDie_@contingent.com.au> scripsit:
> > > I have a form which performs some asynchronous code. I want to
display a
> > > wait cursor when it starts, and hide the wait cursor when it has
completed.
> > > This part works fairly well, using:
> > >
> > > this.TopLevelControl.Cursor =
System.Windows.Forms.Cursors.WaitCursor;
> > >
> > > I also want to prevent user interaction with the controls on my form
while
> > > the wait cursor is displayed, so that use events (except resize and
cancel)
> > > are blocked. What is the recommended way of doing this in .NET?
> >
> > Disable the controls...
> >
> > --
> > Herfried K. Wagner [MVP]
> > <http://www.mvps.org/dotnet>
>
>



Re: Preventing user interaction while showing a "wait" cursor by hirf-spam-me-here

hirf-spam-me-here
Sat Jan 24 05:52:41 CST 2004

* "Justin Rogers" <Justin@games4dotnet.com> scripsit:
> Easier than disabling the controls is displaying a dialog over top of the
> form...
>
> http://weblogs.asp.net/justin_rogers/archive/2004/01/22/61564.aspx
>
> The above code demonstrates the display of a transparent *gamma* form that makes
> the controls darker and intercepts any mouse/keyboard input while the form is
> *busy* or in the case I posted *sleeping*.

This will work too, but notive that transparency isn't supported by all
Windows versions.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>

Re: Preventing user interaction while showing a "wait" cursor by >

>
Sat Jan 24 06:50:33 CST 2004

Better idea this.Hide(). Why let them see what they cant touch?



"Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message
news:eDrpTDn4DHA.540@tk2msftngp13.phx.gbl...
> * "Justin Rogers" <Justin@games4dotnet.com> scripsit:
> > Easier than disabling the controls is displaying a dialog over top of
the
> > form...
> >
> > http://weblogs.asp.net/justin_rogers/archive/2004/01/22/61564.aspx
> >
> > The above code demonstrates the display of a transparent *gamma* form
that makes
> > the controls darker and intercepts any mouse/keyboard input while the
form is
> > *busy* or in the case I posted *sleeping*.
>
> This will work too, but notive that transparency isn't supported by all
> Windows versions.
>
> --
> Herfried K. Wagner [MVP]
> <http://www.mvps.org/dotnet>



Re: Preventing user interaction while showing a "wait" cursor by hirf-spam-me-here

hirf-spam-me-here
Sat Jan 24 06:45:26 CST 2004

* <.> scripsit:
> Better idea this.Hide(). Why let them see what they cant touch?

Mhm... What would you say if an application suddenly is invisible?!

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>

Re: Preventing user interaction while showing a "wait" cursor by >

>
Sat Jan 24 07:40:05 CST 2004

Its not visible, its got another modal form displayed. The lower form is no
longer needed,



"Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message
news:#7Yw0fn4DHA.2756@TK2MSFTNGP09.phx.gbl...
> * <.> scripsit:
> > Better idea this.Hide(). Why let them see what they cant touch?
>
> Mhm... What would you say if an application suddenly is invisible?!
>
> --
> Herfried K. Wagner [MVP]
> <http://www.mvps.org/dotnet>



Re: Preventing user interaction while showing a "wait" cursor by Aaron

Aaron
Sat Jan 24 10:56:21 CST 2004

Thankyou Justin.

I had been toying with the idea of an extra dialogue box, but your
suggestion goes that litte bit further and looks like a great way of
handling the problem. :-)

"Justin Rogers" <Justin@games4dotnet.com> wrote in message
news:ObLDrsj4DHA.2168@TK2MSFTNGP12.phx.gbl...
> Easier than disabling the controls is displaying a dialog over top of the
> form...
>
> http://weblogs.asp.net/justin_rogers/archive/2004/01/22/61564.aspx
>
> The above code demonstrates the display of a transparent *gamma* form that
makes
> the controls darker and intercepts any mouse/keyboard input while the form
is
> *busy* or in the case I posted *sleeping*.
>
>
> --
> Justin Rogers
> DigiTec Web Consultants, LLC.
> Blog: http://weblogs.asp.net/justin_rogers
>
> "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message
> news:ufHS4gQ4DHA.2432@TK2MSFTNGP09.phx.gbl...
> > * "Aaron Queenan" <aqueenan_DieSpammerDie_@contingent.com.au> scripsit:
> > > I have a form which performs some asynchronous code. I want to
display a
> > > wait cursor when it starts, and hide the wait cursor when it has
completed.
> > > This part works fairly well, using:
> > >
> > > this.TopLevelControl.Cursor =
System.Windows.Forms.Cursors.WaitCursor;
> > >
> > > I also want to prevent user interaction with the controls on my form
while
> > > the wait cursor is displayed, so that use events (except resize and
cancel)
> > > are blocked. What is the recommended way of doing this in .NET?
> >
> > Disable the controls...
> >
> > --
> > Herfried K. Wagner [MVP]
> > <http://www.mvps.org/dotnet>
>
>