using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace WindowsFormsApplication1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { double cm = 0; try { cm = Convert.ToDouble(textBox1.Text); textBox2.Text = Convert.ToString(cm); } catch (FormatException f) { textBox2.Text = "BAAAAD"; } } private void textBox1_TextChanged(object sender, EventArgs e) { } private void textBox1_KeyPress(object sender, KeyPressEventArgs e) { textBox1.Text = "h" + textBox1.Text; } } }