if (System.Text.RegularExpressions.Regex.IsMatch(mmH_Text.Text, "[ ^ A-Z a-z cn +-/*~!@#$%^&*()]") || String.IsNullOrEmpty(SetKeyIn.Text) || System.Text.RegularExpressions.Regex.IsMatch(SetKeyIn.Text, "[ ^ A-Z a-z +-/*~!@#$%^&*()]") ) { QtyOfUpright.Text = "error"; } else { QtyOfUpright.Text = Convert.ToInt32(SetKeyIn.Text) * 2 + "Pcs"; QtyOfBasePlate.Text = Convert.ToInt32(SetKeyIn.Text) * 2 + "Pcs"; QtyOfSpacer.Text = Convert.ToInt32(SetKeyIn.Text) * 2 + "Pcs"; QtyOfHB.Text = Convert.ToInt32(SetKeyIn.Text) * 2 + "Pcs"; }
if I use this way like code that show it...
is just meaning :
if (match with text)
{ //error cannot be calculate}
else
{"Calculate"}
So I want to change it to :
if (can be calculate)
{ //calculate the thing}
else
{"Text = Cannot Be Calculate"}
Have any Idea for this way?