Connecting Tech Pros Worldwide Help | Site Map

Is there any metthod to run timer tick event when form is hidden in c#.net

Newbie
 
Join Date: Jul 2006
Location: Gurgaon
Posts: 2
#1: May 30 '07
hi,

I am developing a window application using c#.net.

In the main MDI Form i used a timer, and in timer's tick event i have done some neccessary work.

In this form I also used notifyicon to put application in system tray on minimize, It needed to hide the Form (just like yahoo msgr/google talk).

when application is in maximize state Timer work properly whether it is focused or not, but if application is minimize in system tray, Timer on the form does not work.

I any body know how to run timer event when form is hidden plz suggest.

Jitendra Kumar
Programmer
Protatech India Pvt. Ltd.
Newbie
 
Join Date: Oct 2008
Posts: 2
#2: Nov 3 '08

re: Is there any metthod to run timer tick event when form is hidden in c#.net


Hi
can you please help me telling how to write a program which would nitify the no of issues from tool using the notifyicon
Plater's Avatar
Moderator
 
Join Date: Apr 2007
Location: New England
Posts: 7,150
#3: Nov 3 '08

re: Is there any metthod to run timer tick event when form is hidden in c#.net


I have never heard of this issue, nor have I ever run into it.
My timers function fine regardless of whether they are hidden/visible, minimized/maximized/whatever.
joedeene's Avatar
Site Addict
 
Join Date: Jul 2008
Location: US of A
Posts: 587
#4: Nov 3 '08

re: Is there any metthod to run timer tick event when form is hidden in c#.net


How are you hiding your form? As Plater said, I don't think it matters how your FormState is, but are you changing your timers interval property or enabled property on the hiding event? That could be a problem, or maybe some properties you need to see a form, like the following...

Expand|Select|Wrap|Line Numbers
  1.  int mynumber = 0;
  2.         private void timer1_Tick(object sender, EventArgs e)
  3.         {
  4.  
  5.             mynumber++;
  6.             numericUpDown1.Value = mynumber;
  7.  
  8.         }
You would need the form to be shown rather than not visible to show the numericUpDown control. Although, that's an example you could be using things that don't require the Form's view...

joedeene
Reply