Click here to Skip to main content
12,501,833 members (52,086 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: form
Hello,
I am developing address book in vb.net. I have developed it, but now i want to minimize my form automatically when it is not used for more than one minute.
Please help me out.
Thanks
Posted 25-Jan-13 23:57pm

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

Add a Timer to your form.
Set the timer Interval to 1000 (or one second in milliseconds) and add a Tick event handler
Add a class level private integer and set it to 60 - call it inactiveTime
In the Tick handler, check the value of inactiveTime. If it is zero, do nothing.
Otherwise, decrement it by one. If it is now zero, set the form WindowState to FormWindowState.Minimized
Whenever the user does anything you count as activity, set inactiveTime back to 60.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160919.1 | Last Updated 26 Jan 2013
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100