本文介绍了文本框变为零(0)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

public double numOfP1, numOfP2, piecePr1, piecePr2, prSub1, prSub2, totalSub;

       private void multiplyButton_Click(object sender, EventArgs e)
       {
           if ((price1.Text == null) || (numOfPiece1.Text == null))
           {
               numOfP1 = Convert.ToDouble(numOfPiece1.Text);
               numOfP1 = 0;
               piecePr1 = Convert.ToDouble(price1.Text);
               piecePr1=0;
           }

           if ((price2.Text == null) || (numOfPiece2.Text == null))
           {
               numOfP2 = Convert.ToDouble(numOfPiece2.Text);
               numOfP2 = 0;
               piecePr2 = Convert.ToDouble(price2.Text);
               piecePr2 =0;
           }

           prSub2 = piecePr2 * numOfP2;
           priceSub2.Text = prSub2.ToString();
           prSub1 = piecePr1 * numOfP1;
           priceSub1.Text = prSub1.ToString();
       }
   }




我将numOfP1, piecePr1, numOfP2,piecePr2转到0.它们没有作为我在这些文本框中输入的数字出现.

如何使这些文本框显示我键入的数字.

谢谢,




I got numOfP1, piecePr1, numOfP2,piecePr2 turn to 0. They are not appear as the number I enter into these textboxes.

How can I make these textboxes appear the numbers that I typed in.

thanks,

推荐答案


这篇关于文本框变为零(0)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 00:54