如何在第三个文本框中看到从两个文本框中添加两个数字。 pl,帮帮我。
How can i see the addition of two numbers reading from two text boxes in the third text box. pl, help me.
推荐答案在Windows窗体上添加三个文本框。 然后使用类似下面的代码 - textbox3.Text = Convert.ToDecimal(textbox2.Text)+ Convert.ToDecimal(textbox1.Text); Add three text boxes on a windows form. Then use code similar to following - textbox3.Text = Convert.ToDecimal(textbox2.Text) + Convert.ToDecimal(textbox1.Text);
轻松。 第1步。使用 double.Parse()阅读两个文本框中的文本。您可能想要使用 double.TryParse()以便处理无效输入。 步骤2。添加两个双打 第3步。在第三个文本框中显示文字。 尝试谷歌搜索 double.Parse()如果你以前从未使用过它; - ) Easy. Step 1. Use double.Parse() to read the text in the two textboxes. You may want to use double.TryParse() so you can handle invalid inputs. Step 2. Add the two doubles Step 3. Display the text in the third textbox. Try googling double.Parse() if you have never used it before ;-)