disabling controls

  • Thread starter Thread starter Mike
  • Start date Start date
M

Mike

That is exactly what I am looking for. Just one thing,
after I turn the cursor into a wait cursor, is there a
way to disable all the controls (e.g buttons, textboxes)
so that I can't click on anything, or do I have to
disable each control individually. Again , thanks for
the reply.
-----Original Message-----
Mike,

Something along these lines:
-------------
Cursor = Cursors.WaitCursor;
// ... do processing
Cursor = Cursors.Arrow;
-------------

Is this what you were looking for?

Regards,
Alex





.
..
 
Hi,

You could disable the Form. I would recommend you do this in a try ...
finally block.

try
{
Cursor = Cursors.WaitCursor;
Enabled = false;

// Processing here
}
finally
{
Enabled = true;
Cursor = Cursors.Default;
}

The sample assumes this code is in a member of the Form.

Hope this helps

Chris Taylor
 
I was thinking about doing this but I would prefer to
disable the form without greying out the buttons and
textboxes. Can I do this? Maybe some method can be
called that will cause my app to ignore mouse clicks.
Thanks again for the reply.
 
If you want to, you can create your own custom button class.
Doing all the drawing stuff yourself, you can tell the button to
look like "this" when it is disabled and to look like "that" when
it is enabled...

Hope I understood you question right!

Greetings,
timtos.
 
Back
Top