473,408 Members | 1,761 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,408 software developers and data experts.

How to make app responsive to windows but not to user during long process?


I want to make my app repaint and show a wait cursor during a long
running process but not actually respond to user events. What's the
best way to implement this?

If I just put the process on another thread, the user can continue to
interact with the form. For my own code, I can have a flag in all
event handlers, but what about interaction within a control (i.e.,
expand/collapse tree nodes in treeview). If I change the Enabled
property, that affects the visual appearance of the controls, which I
don't want to do.

Any suggestions/examples?

Thanks,

Sam
Nov 21 '05 #1
13 1472
Samual,

In an earlier situation about such a question as yours I once have given the
idea to set a panel (that holds all controls) on a form and too set that
panel to enable is false.

Is that maybe somehing you are looking for as well. The close and minimize
box is than still working so the user can minimize resize and move that
form.

I hope this helps

Cor

"Samuel R. Neff" <bl****@newsgroup.nospam>
..

I want to make my app repaint and show a wait cursor during a long
running process but not actually respond to user events. What's the
best way to implement this?

If I just put the process on another thread, the user can continue to
interact with the form. For my own code, I can have a flag in all
event handlers, but what about interaction within a control (i.e.,
expand/collapse tree nodes in treeview). If I change the Enabled
property, that affects the visual appearance of the controls, which I
don't want to do.

Any suggestions/examples?

Thanks,

Sam

Nov 21 '05 #2

Thanks, but that still affects the visual display of the controls and
i want to avoid that (the wait cursor indicates that they can't click,
don't need disabled appearance as well).

Sam
On Fri, 7 Jan 2005 17:01:24 +0100, "Cor Ligthert"
<no************@planet.nl> wrote:
Samual,

In an earlier situation about such a question as yours I once have given the
idea to set a panel (that holds all controls) on a form and too set that
panel to enable is false.

Is that maybe somehing you are looking for as well. The close and minimize
box is than still working so the user can minimize resize and move that
form.

I hope this helps

Cor

"Samuel R. Neff" <bl****@newsgroup.nospam>
.

I want to make my app repaint and show a wait cursor during a long
running process but not actually respond to user events. What's the
best way to implement this?

If I just put the process on another thread, the user can continue to
interact with the form. For my own code, I can have a flag in all
event handlers, but what about interaction within a control (i.e.,
expand/collapse tree nodes in treeview). If I change the Enabled
property, that affects the visual appearance of the controls, which I
don't want to do.

Any suggestions/examples?

Thanks,

Sam


Nov 21 '05 #3
Samuel,

In that case they are still there, however a little bit shadowed, I think
this is extra good with a wait cursor.

However just my idea.

Cor
Nov 21 '05 #4
Can't you display a type of "Wait" form then is modal and closes itself when
the waiting period has ended?

"Samuel R. Neff" wrote:

I want to make my app repaint and show a wait cursor during a long
running process but not actually respond to user events. What's the
best way to implement this?

If I just put the process on another thread, the user can continue to
interact with the form. For my own code, I can have a flag in all
event handlers, but what about interaction within a control (i.e.,
expand/collapse tree nodes in treeview). If I change the Enabled
property, that affects the visual appearance of the controls, which I
don't want to do.

Any suggestions/examples?

Thanks,

Sam

Nov 21 '05 #5
"Samuel R. Neff" <bl****@newsgroup.nospam> schrieb:
I want to make my app repaint and show a wait cursor during a long
running process but not actually respond to user events. What's the
best way to implement this?

If I just put the process on another thread, the user can continue to
interact with the form. For my own code, I can have a flag in all
event handlers, but what about interaction within a control (i.e.,
expand/collapse tree nodes in treeview). If I change the Enabled
property, that affects the visual appearance of the controls, which I
don't want to do.

Any suggestions/examples?


\\\
Private m_Busy As Boolean

Protected Property Busy() As Boolean
Get
Return m_Busy
End Get
Set(ByVal Value As Boolean)
m_Busy = Value
End Set
End Property
///

Inside the event handlers, check if the form is busy:

\\\
If Not Me.Busy Then
...
End If
///

Before starting the process, set 'Busy' to 'True' and set it back after the
process has been finished. For some controls, additional logic may be
added, for example, setting 'AutoCheck' to 'False' for checkboxes etc.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #6
Dennis schreef:
Can't you display a type of "Wait" form then is modal and closes itself when
the waiting period has ended?

"Samuel R. Neff" wrote:

I want to make my app repaint and show a wait cursor during a long
running process but not actually respond to user events. What's the
best way to implement this?

If I just put the process on another thread, the user can continue to
interact with the form. For my own code, I can have a flag in all
event handlers, but what about interaction within a control (i.e.,
expand/collapse tree nodes in treeview). If I change the Enabled
property, that affects the visual appearance of the controls, which I
don't want to do.

Any suggestions/examples?

Thanks,

Sam

Can't you make all appropriate controls disabled? I think that makes it
clear to the user as well that no interaction is possible. You can leav
a cancel button enabled, if needed.
Nov 21 '05 #7
Can't you display a type of "Wait" form then is modal and closes itself when
the waiting period has ended?

"Samuel R. Neff" wrote:

I want to make my app repaint and show a wait cursor during a long
running process but not actually respond to user events. What's the
best way to implement this?

If I just put the process on another thread, the user can continue to
interact with the form. For my own code, I can have a flag in all
event handlers, but what about interaction within a control (i.e.,
expand/collapse tree nodes in treeview). If I change the Enabled
property, that affects the visual appearance of the controls, which I
don't want to do.

Any suggestions/examples?

Thanks,

Sam

Nov 21 '05 #8
"Samuel R. Neff" <bl****@newsgroup.nospam> schrieb:
I want to make my app repaint and show a wait cursor during a long
running process but not actually respond to user events. What's the
best way to implement this?

If I just put the process on another thread, the user can continue to
interact with the form. For my own code, I can have a flag in all
event handlers, but what about interaction within a control (i.e.,
expand/collapse tree nodes in treeview). If I change the Enabled
property, that affects the visual appearance of the controls, which I
don't want to do.

Any suggestions/examples?


\\\
Private m_Busy As Boolean

Protected Property Busy() As Boolean
Get
Return m_Busy
End Get
Set(ByVal Value As Boolean)
m_Busy = Value
End Set
End Property
///

Inside the event handlers, check if the form is busy:

\\\
If Not Me.Busy Then
...
End If
///

Before starting the process, set 'Busy' to 'True' and set it back after the
process has been finished. For some controls, additional logic may be
added, for example, setting 'AutoCheck' to 'False' for checkboxes etc.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #9
Dennis schreef:
Can't you display a type of "Wait" form then is modal and closes itself when
the waiting period has ended?

"Samuel R. Neff" wrote:

I want to make my app repaint and show a wait cursor during a long
running process but not actually respond to user events. What's the
best way to implement this?

If I just put the process on another thread, the user can continue to
interact with the form. For my own code, I can have a flag in all
event handlers, but what about interaction within a control (i.e.,
expand/collapse tree nodes in treeview). If I change the Enabled
property, that affects the visual appearance of the controls, which I
don't want to do.

Any suggestions/examples?

Thanks,

Sam

Can't you make all appropriate controls disabled? I think that makes it
clear to the user as well that no interaction is possible. You can leav
a cancel button enabled, if needed.
Nov 21 '05 #10

"Samuel R. Neff" <bl****@newsgroup.nospam> wrote

I want to make my app repaint and show a wait cursor during a long
running process but not actually respond to user events. What's the
best way to implement this?

If I just put the process on another thread, the user can continue to
interact with the form. For my own code, I can have a flag in all
event handlers, but what about interaction within a control (i.e.,
expand/collapse tree nodes in treeview). If I change the Enabled
property, that affects the visual appearance of the controls, which I
don't want to do.

What if they want to move or minimize the form?

You might take a snapshot of the form (including all controls) and
show that in a picturebox that sits on top of all the controls. That would
keep the image of the form and provide you a place to add your
progress bar. They can click on the picture box all they want, while
you don't have to respond.

When the process is over, simply hide the picturebox and all the controls
will be just the way you left them.

LFS
Nov 21 '05 #11

"Samuel R. Neff" <bl****@newsgroup.nospam> wrote

I want to make my app repaint and show a wait cursor during a long
running process but not actually respond to user events. What's the
best way to implement this?

If I just put the process on another thread, the user can continue to
interact with the form. For my own code, I can have a flag in all
event handlers, but what about interaction within a control (i.e.,
expand/collapse tree nodes in treeview). If I change the Enabled
property, that affects the visual appearance of the controls, which I
don't want to do.

What if they want to move or minimize the form?

You might take a snapshot of the form (including all controls) and
show that in a picturebox that sits on top of all the controls. That would
keep the image of the form and provide you a place to add your
progress bar. They can click on the picture box all they want, while
you don't have to respond.

When the process is over, simply hide the picturebox and all the controls
will be just the way you left them.

LFS
Nov 21 '05 #12

Yes, this sounds like a best approach. This way I can also show an
animation like windows explorer processes (i.e., copy file aniim).

Thanks,

Sam
On Fri, 7 Jan 2005 16:29:02 -0800, Dennis
<De****@discussions.microsoft.com> wrote:
Can't you display a type of "Wait" form then is modal and closes itself when
the waiting period has ended?

"Samuel R. Neff" wrote:

I want to make my app repaint and show a wait cursor during a long
running process but not actually respond to user events. What's the
best way to implement this?

If I just put the process on another thread, the user can continue to
interact with the form. For my own code, I can have a flag in all
event handlers, but what about interaction within a control (i.e.,
expand/collapse tree nodes in treeview). If I change the Enabled
property, that affects the visual appearance of the controls, which I
don't want to do.

Any suggestions/examples?

Thanks,

Sam


Nov 21 '05 #13

Yes, this sounds like a best approach. This way I can also show an
animation like windows explorer processes (i.e., copy file aniim).

Thanks,

Sam
On Fri, 7 Jan 2005 16:29:02 -0800, Dennis
<De****@discussions.microsoft.com> wrote:
Can't you display a type of "Wait" form then is modal and closes itself when
the waiting period has ended?

"Samuel R. Neff" wrote:

I want to make my app repaint and show a wait cursor during a long
running process but not actually respond to user events. What's the
best way to implement this?

If I just put the process on another thread, the user can continue to
interact with the form. For my own code, I can have a flag in all
event handlers, but what about interaction within a control (i.e.,
expand/collapse tree nodes in treeview). If I change the Enabled
property, that affects the visual appearance of the controls, which I
don't want to do.

Any suggestions/examples?

Thanks,

Sam


Nov 21 '05 #14

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

Similar topics

11
by: Wolfgang Kaml | last post by:
Hello All, I have been working on this for almost a week now and I haven't anything up my sleeves anymore that I could test in addition or change.... Since I am not sure, if this is a Windows...
2
by: Russ McDaniel | last post by:
Originally posted to microsoft.public.dotnet.distributed_apps with no response. Reposted here with additional thoughts. --- Hello, I'm writing a Windows service which performs some...
7
by: Pavils Jurjans | last post by:
Hello, I wanted to get some light in the subject. As I develop ASP.NET applications, it's necessary to understand how exactly the server- communication happens. It seems like initially...
4
by: Urs Vogel | last post by:
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...
5
by: Dean Slindee | last post by:
I have looked everywhere I can think of for the .exe name of the Windows Picture and Fax Viewer. Anybody know what it's named? Thanks, Dean Slindee
2
by: blueturtle | last post by:
Hi, I'm newbie to C#, and I would like to know what is the common solution to a problem that I encounter. The scenario: Performing a long task, without blocking the UI thread, so it will stay...
15
by: Angelo | last post by:
Hi all, I'm using a FileSystemWatcher to monitor a directory. I want the FSW to pop up my already instantiated but invisible form. However, I'm running into some problems with this. 1) In...
2
by: =?Utf-8?B?d2R1ZGVr?= | last post by:
I have a website using windows integrated security, with anonymous access turned off. The site is used to query orders from a database and when the search takes a long time, a windows login box...
1
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Many websites have a form or a link you can use to download a file. You click a form button or click...
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.