最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

增加两个数字

SEO心得admin45浏览0评论
本文介绍了增加两个数字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

如何在第三个文本框中看到从两个文本框中添加两个数字。 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 ;-)

发布评论

评论列表(0)

  1. 暂无评论