PC Review Forums Newsgroups Microsoft DotNet Microsoft Dot NET Compact Framework display time in my program

Reply

display time in my program

 
Thread Tools Rate Thread
Old 06-03-2007, 11:34 AM   #1
avida
Guest
 
Posts: n/a
Default display time in my program


Hello all,

I'm trying to find the best way to display the clock all the time in
my form.(WM 5.0)a
should I use snapi function or maybe DateTime Class? I'm not realy
sure

Thanks very much in advance

  Reply With Quote
Old 06-03-2007, 12:46 PM   #2
Guest
 
Posts: n/a
Default Re: display time in my program

DateTime.Now


--
Chris Tacke - Embedded MVP
OpenNETCF Consulting
Managed Code in the Embedded World
www.opennetcf.com
--


"avida" <avi@idnext.co.il> wrote in message
news:1173180863.757523.240660@j27g2000cwj.googlegroups.com...
> Hello all,
>
> I'm trying to find the best way to display the clock all the time in
> my form.(WM 5.0)a
> should I use snapi function or maybe DateTime Class? I'm not realy
> sure
>
> Thanks very much in advance
>



  Reply With Quote
Old 08-03-2007, 10:59 PM   #3
Kevin
Guest
 
Posts: n/a
Default Re: display time in my program

Create a Timer (timerUpdateTime) and set the Interval to 1000. Create a
Label (m_DateTime) and place it on your form. In the Tick event for the
timer, add the following code:

private void timerUpdateTime_Tick(object sender, System.EventArgs e)
{
m_DateTime.Text = DateTime.Now.ToString("G");
}

You can set the format to whatever you want.


"<ctacke/>" <ctacke[@]opennetcf[dot]com> wrote in news:u36AF2#XHHA.688
@TK2MSFTNGP03.phx.gbl:

> DateTime.Now
>
>


  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off