Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

To Use another way to write it

$
0
0
            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?


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>