dear all
i try to build the digital clock but it has some problems
and errors plz remove those erros and help me . i am sending the code
plz debug it
i shall be very thankful to u for this act of kindness
the code is as below
#include<conio.h>
#include<stdio.h>
#include<graphics.h>
using System;
using System.WinForms;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Imaging;
public class h2:Form
{
private Image []image=new Bitmap[10];
private Image colon=null;
Timer t=new Timer();
Rectangle rec=new Rectangle(50,50,100,100);
h2()
{
for(int x=0;x<10;x++)
image[x]=new Bitmap(x+".gif");
colon=new Bitmap("colon.gif");
this.Size=new Size(350,50);
this.BorderStyle=FormBorderStyle.None;
this.BackgroundImage=new Bitmap("back5.gif");
this.StartPosition=FormStartPosition.Manual;
this.DesktopLocation=new Point(400,0);
this.ShowInTaskbar=false;
this.TopMost=true;
this.Opacity=0.50;
t.Interval=1000;
t.Tick+=new EventHandler(draw1);
t.Enabled=true;
}
protected override void OnPaint(PaintEventArgs a)
{
Graphics g=a.Graphics;
int hh=DateTime.Now.Hour;
int hh1=hh/10;
int hh2=hh%10;
g.DrawImage(image[hh1],0,1,40,40);
g.DrawImage(image[hh2],40,1,40,40);
g.DrawImage(colon,80,5,30,30);
int mm=DateTime.Now.Minute;
int mm1=mm/10;
int mm2=mm%10;
g.DrawImage(image[mm1],115,1,40,40);
g.DrawImage(image[mm2],155,1,40,40);
g.DrawImage(colon,195,5,30,30);
int ss=DateTime.Now.Second;
int ss1=ss/10;
int ss2=ss%10;
g.DrawImage(image[ss1],230,1,40,40);
g.DrawImage(image[ss2],285,1,40,40);
}
public void draw1(object ob,EventArgs a)
{
this.Invalidate();
}
public static void Main()
{
Application.Run(new h2());
}
}