I am making a quiz application where I would need to have a timer. I was wondering if I can use JavaScript timer on visual studio windows form? It would look nicer with a graphical timer rather then having a number count down.
If yes, then can someone give me a example code on how the JavaScript code is used within a c# windows form?
Windows Forms don’t natively support javascript execution. You’d normally create a graphical timer in a Windows Forms application using Windows controls or GDI+ – or perhaps by embedding a WPF control.
However, you could embed a WebBrowser control in a Windows Forms application. The WebBrowser can display HTML and execute javascript. It’s really just an embedded IE control.
Here are some examples of using GDI+ in a Windows Forms application to draw an analog clock: