Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#
i want to popup my form like messagebox when timer is done ...
iam doing reminder for birthdays (c#).... thanks
Posted 30-Jan-13 15:30pm
Comments
jibesh at 30-Jan-13 20:44pm
   
what is the problem in displaying your form?
ramy fahmy at 30-Jan-13 20:54pm
   
all in want is when the timer is done the main form popup in the center of the screen "iam new in programming"
ramy fahmy at 30-Jan-13 21:16pm
   
and i cant stop my timer
Sergey Alexandrovich Kryukov at 30-Jan-13 20:44pm
   
Timer?! :-)
—SA
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

When whatever event triggers your code, I think what you are asking is to do something like
 
if (this.WindowState == FormWindowState.Minimized) this.WindowState = FormWindowState.Maximized;
 
So if your window is minimised, when the timer event triggers, your form will be maximised.
 
I would imagine you check for the date and time when the timer is triggered, then show the form if the date is the right one (rather than having a timer for each date you want to be reminded of) but you say you are a novice - so go for whatever you are comfortable with and grow from there.
 
timer.Stop will stop your timer.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Timer?! Do you want to keep your application running for years? Smile | :)
 
You would rather need some service which creates a report sends what you need. Of course, you can develop appropriate Windows Service. Only a service will keep working when you log out, and even if you restart the system, it will be started, it you use start mode "Automatic" (http://msdn.microsoft.com/en-us/library/windows/desktop/aa384896%28v=vs.85%29.aspx[^]).
 
But Windows already provides the service designed for such things. It is already bundled with Windows and enabled; you can use it on different levels. It is called Window Task Scheduler, see http://en.wikipedia.org/wiki/Windows_Task_Scheduler[^].
 
First, you can schedule events using command-line utilities AT.EXE or CSHTASKS.EXE (which is replacing AT.EXE), see:
http://en.wikipedia.org/wiki/At_%28Windows%29[^],
http://en.wikipedia.org/wiki/Schtasks[^],
http://technet.microsoft.com/en-us/library/bb490866.aspx[^],
http://msdn.microsoft.com/en-us/library/windows/desktop/bb736357%28v=vs.85%29.aspx[^].
 
And you also can use Window Task Scheduler API, please see:
http://msdn.microsoft.com/en-us/library/windows/desktop/aa383614%28v=vs.85%29.aspx[^],
http://msdn.microsoft.com/en-us/library/windows/desktop/aa383608%28v=vs.85%29.aspx[^].
 
To see how can you use it with .NET, see this CodeProject article: A New Task Scheduler Class Library for .NET[^].
 
—SA
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

To display your Form center of the screen, set the Forms StartPosition property as CenterScreen on design timer on in your constructor.
  Permalink  

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

  Print Answers RSS
0 DamithSL 400
1 Maciej Los 222
2 OriginalGriff 213
3 Zoltán Zörgő 135
4 BillWoodruff 130
0 OriginalGriff 7,969
1 DamithSL 6,139
2 Sergey Alexandrovich Kryukov 5,449
3 Maciej Los 5,309
4 Kornfeld Eliyahu Peter 4,539


Advertise | Privacy | Mobile
Web01 | 2.8.141223.1 | Last Updated 31 Jan 2013
Copyright © CodeProject, 1999-2014
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