views:

242

answers:

3

For a .NET (Winforms) application are there any flip clock controls?

Ideally it would look something like the one found on the BlackBerry Bold:

alt text

UPDATE 1:

Following this SO link I have added an element host to my project to host the WPF retroclock that @Shane mentioned.

UPDATE 2:

A few steps that I followed:

  • Compile RetroClock
  • Add DLL reference to WinForm App
  • Add 'using WPFControls.Clocks;'
  • Add 'elementHost' to Form
  • In Form Load event add:

    //create retroclock

    RetroClock rc = new RetroClock();

    //add retroclock to element host

    elementHost1.Child = rc;

UPDATE 3:

Styling the clock

//style clock
rc.Height = 30;
rc.IncludeLeadingZero = true;
rc.IsAmPmVisible = true;
rc.FontSize = 60;
rc.HorizontalAlignment = System.Windows.HorizontalAlignment.Center;
rc.TimeFormat = TimeFormats.Hour12;
+4  A: 

That would be a little out of place for winforms, the main point of which is to expose the common controls to .Net to help developers build windows applications that use the "standard" look and feel. This doesn't mean you won't find one, but that you should think 3rd party first here. Anything provided by Microsoft is going to be at best an afterthought.

WPF, on the other hand, is a much better fit for this kind of thing.

Joel Coehoorn
+2  A: 

Going along with Joel's answer, there's a simple one for WPF here.

Shane Fulmer
Thanks - I have decided to try and host it in my Winform App.
John M
+2  A: 

It's pretty easy to make one yourself. Add a class, derive it from Control. You'll need a Timer that keeps it going, have its Tick method call Invalidate(). Override OnPaint() to draw the digits and am/pm indicator. You'll want the TextRenderer.DrawText() overload that draws inside a rectangle to get the digits centered. Draw a black line through the center.

Ought to be fun.

Hans Passant
Fun until the boss asks why you are building a clock... : )
John M