定时提醒的小工具
2012年12月08日
⁄ 综合
⁄ 共 6934字 ⁄ 字号
小 中 大
1using System;
2using System.Drawing;
3using System.Collections;
4using System.ComponentModel;
5using System.Windows.Forms;
6using System.Data;
7
8namespace NoticePad
9{
10 /**//// <summary>
11 /// 定时提醒的小工具。
12 /// </summary>
13 public class Form1 : System.Windows.Forms.Form
14 {
15 private System.Windows.Forms.Label label1;
16 private System.Windows.Forms.Label label2;
17 private System.Windows.Forms.TextBox textBox1;
18 private System.Windows.Forms.Timer timer1;
19 private System.Windows.Forms.NumericUpDown ndHour;
20 private System.Windows.Forms.NumericUpDown ndMinute;
21 private System.Windows.Forms.Button btn_OK;
22 private System.ComponentModel.IContainer components;
23
24 public Form1()
25 {
26 //
27 // Windows 窗体设计器支持所必需的
28 //
29 InitializeComponent();
30
31 //
32 // TODO: 在 InitializeComponent 调用后添加任何构造函数代码
33 //
34 }
35
36 /**//// <summary>
37 /// 清理所有正在使用的资源。
38 /// </summary>
39 protected override void Dispose( bool disposing )
40 {
41 if( disposing )
42 {
43 if (components != null)
44 {
45 components.Dispose();
46 }
47 }
48 base.Dispose( disposing );
49 }
50
51 Windows Form Designer generated code#region Windows Form Designer generated code
52 /**//// <summary>
53 /// 设计器支持所需的方法 - 不要使用代码编辑器修改
54 /// 此方法的内容。
55 /// </summary>
56 private void InitializeComponent()
57 {
58 this.components = new System.ComponentModel.Container();
59 this.ndHour = new System.Windows.Forms.NumericUpDown();
60 this.ndMinute = new System.Windows.Forms.NumericUpDown();
61 this.label1 = new System.Windows.Forms.Label();
62 this.label2 = new System.Windows.Forms.Label();
63 this.textBox1 = new System.Windows.Forms.TextBox();
64 this.btn_OK = new System.Windows.Forms.Button();
65 this.timer1 = new System.Windows.Forms.Timer(this.components);
66 ((System.ComponentModel.ISupportInitialize)(this.ndHour)).BeginInit();
67 ((System.ComponentModel.ISupportInitialize)(this.ndMinute)).BeginInit();
68 this.SuspendLayout();
69 //
70 // ndHour
71 //
72 this.ndHour.Location = new System.Drawing.Point(8, 8);
73 this.ndHour.Maximum = new System.Decimal(new int[] {
74 23,
75 0,
76 0,
77 0});
78 this.ndHour.Name = "ndHour";
79 this.ndHour.Size = new System.Drawing.Size(48, 25);
80 this.ndHour.TabIndex = 0;
81 //
82 // ndMinute
83 //
84 this.ndMinute.Location = new System.Drawing.Point(112, 8);
85 this.ndMinute.Maximum = new System.Decimal(new int[] {
86 59,
87 0,
88 0,
89 0});
90 this.ndMinute.Name = "ndMinute";
91 this.ndMinute.Size = new System.Drawing.Size(48, 25);
92 this.ndMinute.TabIndex = 1;
93 //
94 // label1
95 //
96 this.label1.AutoSize = true;
97 this.label1.Location = new System.Drawing.Point(64, 16);
98 this.label1.Name = "label1";
99 this.label1.Size = new System.Drawing.Size(21, 18);
100 this.label1.TabIndex = 2;
101 this.label1.Text = "时";
102 //
103 // label2
104 //
105 this.label2.AutoSize = true;
106 this.label2.Location = new System.Drawing.Point(176, 16);
107 this.label2.Name = "label2";
108 this.label2.Size = new System.Drawing.Size(21, 18);
109 this.label2.TabIndex = 3;
110 this.label2.Text = "分";
111 //
112 // textBox1
113 //
114 this.textBox1.Location = new System.Drawing.Point(8, 40);
115 this.textBox1.Multiline = true;
116 this.textBox1.Name = "textBox1";
117 this.textBox1.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
118 this.textBox1.Size = new System.Drawing.Size(368, 200);
119 this.textBox1.TabIndex = 4;
120 this.textBox1.Text = "写入提醒的内容";
121 //
122 // btn_OK
123 //
124 this.btn_OK.Location = new System.Drawing.Point(232, 8);
125 this.btn_OK.Name = "btn_OK";
126 this.btn_OK.Size = new System.Drawing.Size(136, 24);
127 this.btn_OK.TabIndex = 5;
128 this.btn_OK.Text = "确定并隐藏";
129 this.btn_OK.TextAlign = System.Drawing.ContentAlignment.TopCenter;
130 this.btn_OK.Click += new System.EventHandler(this.btn_OK_Click);
131 //
132 // timer1
133 //
134 this.timer1.Interval = 1000;
135 this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
136 //
137 // Form1
138 //
139 this.AutoScaleBaseSize = new System.Drawing.Size(8, 18);
140 this.ClientSize = new System.Drawing.Size(386, 250);
141 this.Controls.AddRange(new System.Windows.Forms.Control[] {
142 this.btn_OK,
143 this.textBox1,
144 this.label2,
145 this.label1,
146 this.ndMinute,
147 this.ndHour});
148 this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
149 this.MaximizeBox = false;
150 this.Name = "Form1";
151 this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
152 this.Text = "提醒工具";
153 ((System.ComponentModel.ISupportInitialize)(this.ndHour)).EndInit();
154 ((System.ComponentModel.ISupportInitialize)(this.ndMinute)).EndInit();
155 this.ResumeLayout(false);
156
157 }
158 #endregion
159
160