?
Solved

logout when idle

Posted on 2006-04-23
2
Medium Priority
?
490 Views
Last Modified: 2011-09-20
Dear All,
I would like my program execute the exit command when the form is idle for 5 minutes.
Can anyone tell me how to do it please? Thank you.
0
Comment
Question by:chausuenwang
2 Comments
 
LVL 14

Accepted Solution

by:
PockyMaster earned 200 total points
ID: 16518924
You might try the following:

Create a timer: timQuit.
It will be reset on any windows event..
if nothing comes in the timer will expire and close your app

  Protected Overrides Sub DefWndProc(ByRef m As System.Windows.Forms.Message)

        MyBase.DefWndProc(m)
        timQuit.Stop()
        timQuit.Start()
    End Sub

 Private Sub timQuit_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles timQuit.Tick
        Me.Close()
    End Sub
0
 

Author Comment

by:chausuenwang
ID: 16518977
perfect
thax mate
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Loops Section Overview
Suggested Courses
Course of the Month14 days, 23 hours left to enroll

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question