c# Windows窗体应用程序设计(五)
本次来介绍时钟控件、日历控件和MDI窗口。
1.时钟控件和日历控件
1.新建项目
1.新建一个名为时钟和日历控件的项目,再将Name属性改为FormCalendar。
2.添加控件
所要添加的控件及修改属性如下:
添加后的效果如下:
3.添加代码
各个部件需要添加的代码如下:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace 时钟控件和_日历控件
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void trackBar1_Scroll(object sender, EventArgs e)
{
if (trackBar1.Value > 0)
timerCalendar.Interval = 10;