用C#制作有提示窗体的日程管理器

本文介绍了如何使用C#来创建一个具有提示功能的日程管理器。通过C#代码实现主窗体和提示窗体,包括添加、删除日程以及在特定时间显示提醒的功能。主要涉及控件如TextBox、Button、Timer等,并利用OleDb进行数据库操作。
摘要由CSDN通过智能技术生成

用C#制作有提示窗体的日程管理器

以下为主窗体代码:

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Timers;
using System.Data.OleDb;
namespace Calendar
{
 /// <summary>
 /// Form1 的摘要说明。
 /// </summary>
 public class Form1 : System.Windows.Forms.Form
 {
  private System.Windows.Forms.TabControl tabControl1;
  private System.Windows.Forms.TabPage first;
  private System.Windows.Forms.TabPage tabPage1;
  private System.Windows.Forms.Button button1;
  private System.Windows.Forms.Button button2;
  private System.Windows.Forms.Button button3;
  private System.Windows.Forms.Button button4;
  private System.Windows.Forms.Button button5;
  private System.Windows.Forms.TextBox textBox1;
  private System.Windows.Forms.TextBox textBox2;
  private System.Windows.Forms.Label label1;
  private System.Windows.Forms.Label label2;
  private System.Windows.Forms.Label label3;
  private System.Windows.Forms.GroupBox groupBox1;
  private System.Windows.Forms.TextBox textBox3;
  private System.Windows.Forms.TabPage tabPage2;
  private System.Windows.Forms.TabPage tabPage3;
  private System.Windows.Forms.Timer timer1;
  private System.Windows.Forms.TextBox textBox4;
  private System.Data.OleDb.OleDbConnection Myconn;
  private System.Data.OleDb.OleDbCommand Mycmd;
  private System.ComponentModel.IContainer components;

  public OleDbDataReader dr;
  public string info;
  private System.Windows.Forms.TextBox textBox5;
  private System.Windows.Forms.CheckedListBox checkedListBox1;
  private System.Windows.Forms.Label label4;
  private System.Windows.Forms.TextBox textBox6;
  private System.Data.OleDb.OleDbCommand insertcmd;
  public DateTime da;
  public Form1()
  {
   //
   // Windows 窗体设计器支持所必需的
   //
   InitializeComponent();

   //
   // TODO: 在 InitializeComponent 调用后添加任何构造函数代码
   //
  }

  /// <summary>
  /// 清理所有正在使用的资源。
  /// </summary>
  protected override void Dispose( bool disposing )
  {
   if( disposing )
   {
    if (components != null)
    {
     components.Dispose();
    }
   }
   base.Dispose( disposing );
  }

  #region Windows 窗体设计器生成的代码
  /// <summary>
  /// 设计器支持所需的方法 - 不要使用代码编辑器修改
  /// 此方法的内容。
  /// </summary>
  private void InitializeComponent()
  {
   this.components = new System.ComponentModel.Container();
   System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form1));
   this.tabControl1 = new System.Windows.Forms.TabControl();
   this.tabPage1 = new System.Windows.Forms.TabPage();
   this.textBox5 = new System.Windows.Forms.TextBox();
   this.groupBox1 = new System.Windows.Forms.GroupBox();
   this.textBox3 = new System.Windows.Forms.TextBox();
   this.label3 = new System.Windows.Forms.Label();
   this.label2 = new System.Windows.Forms.Label();
   this.label1 = new System.Windows.Forms.Label();
   this.textBox2 = new System.Windows.Forms.TextBox();
   this.textBox1 = new System.Windows.Forms.TextBox();
   this.button4 = new System.Windows.Forms.Button();
   this.button3 = new System.Windows.Forms.Button();
   this.first = new System.Windows.Forms.TabPage();
   this.button5 = new System.Windows.Forms.Button();
   this.tabPage2 = new System.Windows.Forms.TabPage();
   this.tabPage3 = new System.Windows.Forms.TabPage();
   this.button1 = new System.Windows.Forms.Button();
   this.button2 = new System.Windows.Forms.Button();
   this.timer1 = new System.Windows.Forms.Timer(this.components);
   this.textBox4 = new System.Windows.Forms.TextBox();
   this.Myconn = new System.Data.OleDb.OleDbConnection();
   this.Mycmd = new System.Data.OleDb.OleDbCommand();
   this.checkedListBox1 = new System.Windows.Forms.CheckedListBox();
   this.label4 = new System.Windows.Forms.Label();
   this.textBox6 = new System.Windows.Forms.TextBox();
   this.insertcmd = new System.Data.OleDb.OleDbCommand();
   this.tabControl1.SuspendLayout();
   this.tabPage1.SuspendLayout();
   this.groupBox1.SuspendLayout();
   this.first.SuspendLayout();
   this.SuspendLayout();
   //
   // tabControl1
   //
   this.tabControl1.Controls.Add(this.tabPage1);
   this.tabControl1.Controls.Add(this.first);
   this.tabControl1.Controls.Add(this.tabPage2);
   this.tabControl1.Controls.Add(this.tabPage3);
   this.tabControl1.Location = new System.Drawing.Point(0, 0);
   this.tabControl1.Name = "tabControl1";
   this.tabControl1.SelectedIndex

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值