form1.cs

来自「微软(Microsoft)出版社C井练习文件及解答」· CS 代码 · 共 51 行

CS
51
字号
#region Using directives

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Windows.Forms;

#endregion

namespace Selection
{
    partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void quit_Click(object sender, System.EventArgs e)
        {
            Application.Exit();
        }

        private void compare_Click(object sender, System.EventArgs e)
        {
            int diff = dateCompare(first.Value, second.Value);
            info.Text = "";
            show("first == second", diff == 0);
            show("first != second", diff != 0);
            show("first <  second", diff < 0);
            show("first <= second", diff <= 0);
            show("first >  second", diff > 0);
            show("first >= second", diff >= 0);
        }

        private void show(string exp, bool result)
        {
            info.Text += exp;
            info.Text += " : " + result.ToString();
            info.Text += "\r\n";
        }

        private int dateCompare(DateTime leftHandSide, DateTime rightHandSide)
        {
            // TO DO
            return 42;
        }
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?