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

Application.Idle

Rob
How can I write the following code in VB.NET :

private void Form1_Load(object sender, System.EventArgs e)
{
// Submit to Idle event to set controls state at idle time
Application.Idle += new EventHandler(Application_Idle);
}

private void Application_Idle(object sender, EventArgs e)
{
SetStateOfControls();
}

Also is ther a way to turn the Application.Idle on or off with
an on or off button ?
Nov 21 '05 #1
1 5256
"Rob" <rl*****@worldnet.att.net> schrieb:
How can I write the following code in VB.NET :

private void Form1_Load(object sender, System.EventArgs e)
{
// Submit to Idle event to set controls state at idle time
Application.Idle += new EventHandler(Application_Idle);
}

private void Application_Idle(object sender, EventArgs e)
{
SetStateOfControls();
}

Also is ther a way to turn the Application.Idle on or off with
an on or off button ?


\\\

' Add handler.
AddHandler Application.Idle, AddressOf Me.Application_Idle

' Remove handler.
RemoveHandler Application.Idle, AddressOf Me.Application_Idle
..
..
..
Private Sub Application_Idle(ByVal sender As Object, ByVal e As EventArgs)
...
End Sub
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Nov 21 '05 #2

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

Similar topics

2
by: Chien Lau | last post by:
I have a form class that acts as a top level window. The user can open and close any number of these windows throughout the lifetime of the application. In the OnLoad, I have: ...
19
by: Frank Rizzo | last post by:
I want to log the user out when there has been a period of inactivity in the application. The key here is inactivity of the application, not the system. I know that you can retrieve the...
5
by: Frank Rizzo | last post by:
Hello, I have a dozen 3rd party controls on my form. I am trying to detect when the application is idle. But even after the mouse and the keyboard are no longer moving, something is still...
20
by: J-T | last post by:
We are working on an asp.net application which is a 3-tier application.I was aksed to create a component which monitors a folder and gets the file and pass them to a class library in our business...
2
by: sbcglobal | last post by:
Anyone knows how to add an Application.Idle handler in VB .Net Private WithEvents ?????????? As ???????? Public Sub IdleEvent(ByVal sender As System.Object, ByVal e As System.EventArgs)...
2
by: henk | last post by:
I have a hard time to get the idle time only from my application. (a relogin box should appear after eg 1 min, when a user switch to word and start typing for 10min, the re-login should not appear....
5
by: toddles666 | last post by:
Hi- Is there any way of restricting access to a database by application & account? For example, I only want the application APP1 to access the database using the USER1 account. I've tried to...
3
by: Peri | last post by:
Dear All, Can you please help me out in detecting the application idle time. I would like to lock the application if it is idle for more that 10 minutes. FYI - I have already tried...
1
by: Visu | last post by:
Hi All! How to find the application idle time in VB.NET windows application? We can get the windows Idle time Private Declare Function GetLastInputInfo Lib "user32.dll" But i want the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
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
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...

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.