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); } }
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); }
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++; }
private void standartToolStripMenuItem_Click(object sender, EventArgs e) { this.BackColor = Color.LightGray; menuStrip1.BackColor = Color.FloralWhite; Logs.getInstance().addEntry("changend colour to standard.."); }
private void grünToolStripMenuItem_Click(object sender, EventArgs e) { this.BackColor = Color.DarkGreen; menuStrip1.BackColor = Color.DarkOrange; Logs.getInstance().addEntry("changend colour to green.."); }
private void blauToolStripMenuItem_Click(object sender, EventArgs e) { this.BackColor = Color.Aqua; menuStrip1.BackColor = Color.DarkOrange; Logs.getInstance().addEntry("changed colour to blue.."); }
private void gelbToolStripMenuItem_Click(object sender, EventArgs e) { this.BackColor = Color.Yellow; menuStrip1.BackColor = Color.DarkOrange; Logs.getInstance().addEntry("changed colour to yellow.."); }
private void btnClear_Click(object sender, EventArgs e) { tbxName.Text = ""; Logs.getInstance().addEntry("cleared textbox.."); }
public frmMain() { InitializeComponent(); Logs.getInstance().addEntry("start program.."); }
private void btnClose_Click(object sender, EventArgs e) { Logs.getInstance().addEntry("frame 'age' closed.."); Dispose(); }
private void btnClear_Click(object sender, EventArgs e) { Logs.getInstance().addEntry("cleared textbox 'age'.."); tbxAge.Text = ""; }
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { Logs.getInstance().Show(); }
public Age(frmMain main) { InitializeComponent(); this.BackColor = main.BackColor; Logs.getInstance().addEntry("opened frame 'age'.."); }