using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Windows.Forms;
namespace DigitalClock
{
/// <summary>
/// DigitalClock 的摘要说明。
/// </summary>
public class DigitalClock1: System.Windows.Forms.UserControl
{
private System.Windows.Forms.Label LocalTimerlabel;
private System.Windows.Forms.Timer timer1;
private System.ComponentModel.IContainer components;
public DigitalClock()
{
// 该调用是 Windows.Forms 窗体设计器所必需的。
InitializeComponent();
// TODO: 在 InitializeComponent 调用后添加任何初始化
}//
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
///
public event System.EventHandler RaiseTimer1_Tick;
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器
/// 修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.LocalTimerlabel = new System.Windows.Forms.Label();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.SuspendLayout();
//
// LocalTimerlabel
//
this.LocalTimerlabel.BackColor = System.Drawing.SystemColors.ControlDark;
this.LocalTimerlabel.Location = new System.Drawing.Point(88, 104);
this.LocalTimerlabel.Name = "LocalTimerlabel";
this.LocalTimerlabel.Size = new System.Drawing.Size(144, 23);
this.LocalTimerlabel.TabIndex = 0;
this.LocalTimerlabel.Text = "\"\"";
//
// timer1
//
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
//
// DigitalClock
//
this.Controls.Add(this.LocalTimerlabel);
this.Name = "DigitalClock";
this.Size = new System.Drawing.Size(328, 264);
this.ResumeLayout(false);
}
#endregion
private void timer1_Tick(object sender, System.EventArgs e)
{
LocalTimerlabel.Text=System.DateTime.Now.ToString();
if(RaiseTimer1_Tick !=null)
RaiseTimer1_Tick(sender,e);
}
public bool Timer1_Enabled
{
get
{
return Timer1_Enabled;
}
set
{
Timer.Enabled=value;
}
}
public Color LocalTimeLabel_BackColor
{
get
{
return LocalTimeLabel.BackColor;
}
set
{
LocalTimeLabel.BackColor=value;
}
}
}
}
红色字体的地方出现错误,提示类,结构或接口方法必须有返回类型。
我应该怎样更正,请指点一下。