Hi everyone i have a key down event as follows
if (e.KeyCode == Keys.C && e.KeyCode == Keys.Enter || e.KeyCode == Keys.Return)
{
var amount = textBox1.Text;
var total = label3.Text;
decimal damount = Math.Round(Convert.ToDecimal(amount), 2);
decimal dtotal = Convert.ToDecimal(total);
var ntotal = dtotal - damount;
var ndue = Math.Round(Convert.ToDecimal(ntotal), 2);
var ntotal1 = Convert.ToString(ndue);
if (ndue <= 0)
{
panel4.Show();
label4.Text = ntotal1;
}
else
{
label3.Text = ntotal1;
}
textBox1.Text = "";
textBox1.Focus();
}
this event works like i want it but here is my question how do i when reading the textbox1.text ignore character such as c or a , since the keydown requires c it messes with my decimal conversion any suggestions