Application.idle event issue

M

Muthu

In our application, in the Application.idle event the controls are validated
and enabled. As the idle event is fired when the application queue is empty,
the validation and enabling of controls is firing continuously. This
implementation makes the system using 10% CPU processing time when 10 or more
users are using the application because most applications spend 99% of their
time in an idle state.

When I moved the control validation and enabling activity into the mouse and
keyboard events of the Mainframe class, the events are firing only keyboard
and mouse events of the Mainframe class and not always.

Can you anyone please give an alternate solution for this problem?
 
M

Morten Wennevik [C# MVP]

Muthu said:
In our application, in the Application.idle event the controls are validated
and enabled. As the idle event is fired when the application queue is empty,
the validation and enabling of controls is firing continuously. This
implementation makes the system using 10% CPU processing time when 10 or more
users are using the application because most applications spend 99% of their
time in an idle state.

When I moved the control validation and enabling activity into the mouse and
keyboard events of the Mainframe class, the events are firing only keyboard
and mouse events of the Mainframe class and not always.

Can you anyone please give an alternate solution for this problem?

? Why would you use Application.Idle? I would consider getting notified on
Idle for tasks that should run when the user is 'away'. I may be missing
something, but control validation typically happens when you move (or attempt
to move) away from a control, or as part of a user action like clicking on a
submit-button or similar.

If you give us more detailed information regarding your application we can
give you better design suggestions.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top