本帖最后由 孟勃宇 于 2013-5-16 09:09 编辑
求教啊!!!
class time
{
private int hour;
private int minute;
private int second;
public time()
{
hour = System.DateTime.Now.Hour;
minute = System.DateTime.Now.Minute;
second = System.DateTime.Now.Second; }
public time(int h, int m, int s)
{
hour = h;
second = s;
minute = m;
}
public void addsecond()
{
second++;
if (second >= 60)
{
second = second % 60;
minute++;
}
if (minute >= 60)
{
minute = minute % 60;
hour++;
}
}
一共有三个textbook框 ,里面分别输出 小时,分钟,和秒, 当按下按钮时,秒的数增加1,怎样把这些代码补充完整,求指教啊。 |