示例#1
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            if (tbxAge.Text == "")
            {
                Logs.getInstance().addEntry("no age typed in ..");
                return;
            }

            if (!parseOK())
            {
                Logs.getInstance().addEntry("typed incorrect age..");
                return;
            }
            else
            {
                Logs.getInstance().addEntry("typed age..");
                int age = Int32.Parse(tbxAge.Text);
                if (age < 1)
                {
                    Logs.getInstance().addEntry("typed value smaller than 1..");
                    MessageBox.Show("Are you really younger than one year?", "Information", MessageBoxButtons.OK);
                    return;
                }

                DateTime aDate = DateTime.Now;
                MessageBox.Show("You could have been borned in " + (aDate.Year - age) + ".", "Information", MessageBoxButtons.OK);
            }
        }
示例#2
0
文件: Form1.cs 项目: Matbit/Log
        private void btnOK_Click(object sender, EventArgs e)
        {
            if (tbxName.Text == "")
            {
                Logs.getInstance().addEntry("clicked ok button..");
                return;
            }

            Logs.getInstance().addEntry("entered new name...");
            MessageBox.Show("Beautiful name! It has " + tbxName.TextLength + " letters.", "Information", MessageBoxButtons.OK);
        }
示例#3
0
文件: Form1.cs 项目: Matbit/Log
 private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
 {
     if (count % 2 == 0)
     {
         Logs.getInstance().Hide();
         Logs.getInstance().addEntry("closed logs..");
     }
     else
     {
         Logs.getInstance().addEntry("opened logs..");
         Logs.getInstance().Show();
     }
     count++;
 }
示例#4
0
文件: Form1.cs 项目: Matbit/Log
 private void standartToolStripMenuItem_Click(object sender, EventArgs e)
 {
     this.BackColor       = Color.LightGray;
     menuStrip1.BackColor = Color.FloralWhite;
     Logs.getInstance().addEntry("changend colour to standard..");
 }
示例#5
0
文件: Form1.cs 项目: Matbit/Log
 private void grünToolStripMenuItem_Click(object sender, EventArgs e)
 {
     this.BackColor       = Color.DarkGreen;
     menuStrip1.BackColor = Color.DarkOrange;
     Logs.getInstance().addEntry("changend colour to green..");
 }
示例#6
0
文件: Form1.cs 项目: Matbit/Log
 private void blauToolStripMenuItem_Click(object sender, EventArgs e)
 {
     this.BackColor       = Color.Aqua;
     menuStrip1.BackColor = Color.DarkOrange;
     Logs.getInstance().addEntry("changed colour to blue..");
 }
示例#7
0
文件: Form1.cs 项目: Matbit/Log
 private void gelbToolStripMenuItem_Click(object sender, EventArgs e)
 {
     this.BackColor       = Color.Yellow;
     menuStrip1.BackColor = Color.DarkOrange;
     Logs.getInstance().addEntry("changed colour to yellow..");
 }
示例#8
0
文件: Form1.cs 项目: Matbit/Log
 private void btnClear_Click(object sender, EventArgs e)
 {
     tbxName.Text = "";
     Logs.getInstance().addEntry("cleared textbox..");
 }
示例#9
0
文件: Form1.cs 项目: Matbit/Log
 public frmMain()
 {
     InitializeComponent();
     Logs.getInstance().addEntry("start program..");
 }
示例#10
0
 private void btnClose_Click(object sender, EventArgs e)
 {
     Logs.getInstance().addEntry("frame 'age' closed..");
     Dispose();
 }
示例#11
0
 private void btnClear_Click(object sender, EventArgs e)
 {
     Logs.getInstance().addEntry("cleared textbox 'age'..");
     tbxAge.Text = "";
 }
示例#12
0
 private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
 {
     Logs.getInstance().Show();
 }
示例#13
0
 public Age(frmMain main)
 {
     InitializeComponent();
     this.BackColor = main.BackColor;
     Logs.getInstance().addEntry("opened frame 'age'..");
 }