473,407 Members | 2,306 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,407 software developers and data experts.

disabling controls

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
"Mike" <mi*******@hotmail.com> wrote in message
news:0a****************************@phx.gbl...
Currently, when my application needs to write/read to a
database, there is a time lag. In that time lag, a user can click the same button multiple times causing my app
problems. I want to turn the mouse pointer arrow into an hourglass and ignore mouse clicks until my app finishes
working. Most commercial apps I've looked at do this.
Is there an easy way to do this (ie. any built-in
controls in VS.NET or classes in MSDN)? Any suggestions and/or code samples would be greatly appreciated. Thank you for the reply.

Mike

.

..
Nov 15 '05 #1
3 1684
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
"Mike" <mi*******@hotmail.com> wrote in message
news:5e****************************@phx.gbl...
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
"Mike" <mi*******@hotmail.com> wrote in message
news:0a****************************@phx.gbl...
Currently, when my application needs to write/read to a
database, there is a time lag. In that time lag, a user can click the same button multiple times causing my app
problems. I want to turn the mouse pointer arrow into an hourglass and ignore mouse clicks until my app finishes
working. Most commercial apps I've looked at do this.
Is there an easy way to do this (ie. any built-in
controls in VS.NET or classes in MSDN)? Any suggestions and/or code samples would be greatly appreciated. Thank you for the reply.

Mike

.

.

Nov 15 '05 #2
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.
-----Original Message-----
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
"Mike" <mi*******@hotmail.com> wrote in message
news:5e****************************@phx.gbl...
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
>
>
>"Mike" <mi*******@hotmail.com> wrote in message
>news:0a****************************@phx.gbl...
>> Currently, when my application needs to write/read to a >> database, there is a time lag. In that time lag, a

user
>> can click the same button multiple times causing my app >> problems. I want to turn the mouse pointer arrow into
an
>> hourglass and ignore mouse clicks until my app

finishes >> working. Most commercial apps I've looked at do this. >> Is there an easy way to do this (ie. any built-in
>> controls in VS.NET or classes in MSDN)? Any

suggestions
>> and/or code samples would be greatly appreciated.

Thank
>> you for the reply.
>>
>> Mike
>
>
>.
>

.

.

Nov 15 '05 #3
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.

"Mike" <mi*******@hotmail.com> wrote in message news:08****************************@phx.gbl...
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.
-----Original Message-----
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
"Mike" <mi*******@hotmail.com> wrote in message
news:5e****************************@phx.gbl...
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
>
>
>"Mike" <mi*******@hotmail.com> wrote in message
>news:0a****************************@phx.gbl...
>> Currently, when my application needs to write/read to a >> database, there is a time lag. In that time lag, a
user
>> can click the same button multiple times causing my app >> problems. I want to turn the mouse pointer arrow into an
>> hourglass and ignore mouse clicks until my app finishes >> working. Most commercial apps I've looked at do this. >> Is there an easy way to do this (ie. any built-in
>> controls in VS.NET or classes in MSDN)? Any
suggestions
>> and/or code samples would be greatly appreciated.
Thank
>> you for the reply.
>>
>> Mike
>
>
>.
>
.

.

Nov 15 '05 #4

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

Similar topics

0
by: Ashish Shridharan | last post by:
Hi All, Has anyone ever tried disabling a checkbox or a radiobutton web server control in netscape ? While a textbox and a button control renders disabled, .NET adds the disabled attribute to...
1
by: John | last post by:
Hi How can I disable or hide a menu item via vba? Thanks Regards
1
by: Jason Galvin | last post by:
I would like to disable the auto-populating feature (remembers form element text between post-backs) when creating a .NET form. I have succeeded in disabling auto-populate by creating my controls...
4
by: Dan =o\) | last post by:
Hi guys, in the scenario where a user fills in a form, and clicks on a button to Save, there's a period of waiting (the slower the connection between client and server, the longer the delay)...
4
by: louise raisbeck | last post by:
Hi there, I have put some web controls, textboxes and drop down lists, in a Panel, so that under a certain condition i can disable all fields for input. I read in Help that disabling a Panel...
7
by: John Meyer | last post by:
I have a program where I have to enable or disable a list box based upon a radio button. Is there an "enabled" property on select boxes?
2
by: dm1608 | last post by:
I have to issues: 1) Does anyone know of a programmatic way I can disable all textboxes, combo, listboxes, and buttons on a form? 2) What is the best practice for disabling multiple controls...
11
by: shankwheat | last post by:
I have a function which passes text from txtdebt to debtsbox which works fine. However, I want to add code which examines the value of debtsbox and if any of the values the user entered contain the...
5
by: jehugaleahsa | last post by:
Hello: I am sure this question comes up a lot. I need to disable the controls on my Windows forms so that when the BindingSource is empty some the controls bound to it will be disabled. This...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.