private void BtnReset_Click(object sender, EventArgs e) { TBlbsTOkgs.Text = ""; numDouble = 0.00; numDouble2 = 0.00; TBlbsTOkgs.Focus(); }
private void PictureBox1_Click(object sender, EventArgs e) { if (TBlbsTOkgs.Text == "0") { MessageBox.Show("Please enter a numeric value different to 0", "No valid data entered"); TBlbsTOkgs.Focus(); } else { if (double.TryParse(TBlbsTOkgs.Text, out numDouble)) { numDouble2 = numDouble * 2.20462; TBlbsTOkgs.Text = numDouble2.ToString(); } else { MessageBox.Show("Please enter a numeric value to convert", "No valid data entered"); TBlbsTOkgs.Focus(); } } }