473,566 Members | 2,770 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Set a form into a non-responsive state

Hi

I would like to set a Windows.Form into a non responsive state, i.e. that it
does not respond to user input of any kind, similar to the state a forms
gets when another modal form is opened ontop with ShowDialog(). Form.Enabled
= false is not what I'm looking for, it changes the look of the form by
graying the window caption and the controls and is (very) slow, too.

I need this behaviour to prevent the user from entering data or clicking
onto controls while data is being processed on a server. In order to keep
the event thread responsive, the call to the server is launched from another
thread, so it can repaint and show intermediate results received from the
server. Once the final result is returned from the server, the form should
get back into a normal responsive state.

Any hints?

Thanks
Urs
Nov 20 '05 #1
4 1368
* "Urs Vogel" <ur******@yahoo .com> scripsit:
[...]

Please don't multipost. See my reply in the other group.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #2
> I would like to set a Windows.Form into a non responsive state, i.e. that
it
does not respond to user input of any kind, similar to the state a forms
gets when another modal form is opened ontop with ShowDialog(). Form.Enabled = false is not what I'm looking for, it changes the look of the form by
graying the window caption and the controls and is (very) slow, too. (...)


Hide the form (Visible=False) , pop up the "Processing ..." dialog with the
progress bar, animated hourglass or something. When the processing is done,
close the "Processing ..." dialog and set the form back to the visible state.

sincerely,
--
Sebastian Zaklada
Skilled Software
http://www.skilledsoftware.com
*************** *************** ******
SQL Source Control 2003 - for
SQL Server Source Safe integration
and custom databases documentation
Nov 20 '05 #3
"Urs Vogel" <ur******@yahoo .com> schrieb
Hi

I would like to set a Windows.Form into a non responsive state, i.e.
that it does not respond to user input of any kind, similar to the
state a forms gets when another modal form is opened ontop with
ShowDialog(). Form.Enabled = false is not what I'm looking for, it
changes the look of the form by graying the window caption and the
controls and is (very) slow, too.

I need this behaviour to prevent the user from entering data or
clicking onto controls while data is being processed on a server. In
order to keep the event thread responsive, the call to the server is
launched from another thread, so it can repaint and show intermediate
results received from the server. Once the final result is returned
from the server, the form should get back into a normal responsive
state.

Any hints?


You wrote
"I would like to set a Windows.Form into a non responsive state..."
and
"In order to keep the event thread responsive,..."

Contradiction? :-)

Either the UI is responsive or not. As you want to display something, it
must be responsive. I assume you don't want to create a 2nd UI thread, so I
see 2 ways:
a) disable all controls that should not be usable by the user during the
process
b) show another (modal) progress/result form, so you don't have to disable
the current form.
--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #4
Lol - I could do with this tip too. At the moment, I'm manually "disabling"
those windows I don't want interaction with while the server thread is
running. It causes some flicker and is slow -

I guess some way of intercepting the message pump would be useful.

"Urs Vogel" <ur******@yahoo .com> wrote in message
news:Om******** *****@TK2MSFTNG P11.phx.gbl...
Hi

I would like to set a Windows.Form into a non responsive state, i.e. that it does not respond to user input of any kind, similar to the state a forms
gets when another modal form is opened ontop with ShowDialog(). Form.Enabled = false is not what I'm looking for, it changes the look of the form by
graying the window caption and the controls and is (very) slow, too.

I need this behaviour to prevent the user from entering data or clicking
onto controls while data is being processed on a server. In order to keep
the event thread responsive, the call to the server is launched from another thread, so it can repaint and show intermediate results received from the
server. Once the final result is returned from the server, the form should
get back into a normal responsive state.

Any hints?

Thanks
Urs

Nov 20 '05 #5

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

Similar topics

1
1901
by: Sean Abrahams | last post by:
The following is a reprint of a message I sent to the tutor list a long time ago, that I haven't gotten around to discussing with anyone else and failed to hear a reply on the tutor list. Hoping someone here may want to have some dialog. -- I'm learning to write unit tests and am trying to write them for a web application I'm working on.
4
1791
by: Yasutaka Ito | last post by:
Hi, As you know, all the non-ui components (like Timer control, etc.) that sit on the form are contained in its private variable 'components'. How can I enumerate such components from any form instance given to me? I have no access to the source of the given form instance, but I can impose that the form be inherited from certain base...
2
1767
by: Mark | last post by:
Hi all, Is there a "standard" way to structure a small windows form such that it can run non-interactively with an appropriate command line switch? E.g, if I run the form normally I get the form's UI, but if I run it with /q (or whatever), it runs non-interactively (perhaps logging to the event log). I did try parsing the command line in...
4
3039
by: Dave | last post by:
I need to add the ability to drag from a Windows Form and drop into a non dotNet application. For example, having a generated image in my app that I wish to drag out into explorer as a friendly way to save it. I have tried creating the object that I place into the DoDragDrop() by inheriting the COM interfaces IDropSource and IDataObject...
5
1050
by: Tiraman | last post by:
Hi, i have some questions about non-rectangular forms 1) i build a form as a non-rectangular by setting the form background to some bmp file and the transparenceyKey to the color which i want to make transparent and every thing ok BUT when i m replacing the bmp file i can see the new one in the form designer but when i m running the...
7
1530
by: jmp | last post by:
(I hope this isn't considered too far off-topic.) I work as a developer on a browser product found on handheld devices, and I'm trying to specify behavior for the browser to make it "as compatible as possible" with reference browsers (IE, Firefox, Opera, NS, etc??) when presented with HTML content containing form controls (input, textarea,...
3
4159
by: Harry_Crow | last post by:
I wanted to change the Non client area height. This was not possible in the existing Form TitleBar. So I set the FormBorderStyle= None and I calculated and introduced the Non Client area myself. So the height and width of the Non Client area is 15 and 4 pixels border respectively. Also the Nonclient area has been painted as per our need. Now...
0
1705
by: scottf35 | last post by:
Hi, I am working on (read that - upgrading) an application. This application creates an HTTPWebRequest object, populates it with values which are then sucked out of the Request.Form object (eg someVariable = Request.Form) My problem is that the app doesn't allow input of non-ASCII data in the form. To resolve this I have replace the...
5
1675
by: raylopez99 | last post by:
I have a form, Form6, that has a bunch of buttons overlaid on it. I want to be able to click on any arbitrary area of the form, and if that area of the form is overlaid by a button, I want to change the color of the button to Coral, and show a MessageBox with the button name. So far, I've tried the below event handlers, and the only one...
2
5582
DonRayner
by: DonRayner | last post by:
This one has me stumped. I'm getting a "Type Mismatch" error on one of my forms when it's being opened. It's hapening before the forms "On Open" event, I stuck a msgbox in there to check and I'm getting the error before it opens. The line of code that calls the form from another form is. DoCmd.OpenForm...
0
7666
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7584
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7888
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7644
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7951
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6260
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3643
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1201
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.