如何在标签和下一个按钮中添加两个文本框值单击Label + Txt1 + Txt2? [英] How Can I Add Two Textbox Values In Label And Next Button Click Label +Txt1 +Txt2 ?

查看:75
本文介绍了如何在标签和下一个按钮中添加两个文本框值单击Label + Txt1 + Txt2?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以做什么,添加两个文本框值并导致lable然后标签值应该添加到按钮点击事件上的下一个文本框添加,在Windows中使用双数据类型c#.net

what can i do ,for addition of two textbox values and result in lable and then label value should be added to next addition of textboxes on button click event with double data type in windows c#.net

推荐答案

这很简单:

It's pretty easy:
double d1 , d2, l1;
if (!double.TryParse(textbox1.Text, out d1)) throw new ArgumentException("Text box 1 needs to be numeric");
if (!double.TryParse(textbox2.Text, out d2)) throw new ArgumentException("Text box 2 needs to be numeric");
if (!double.TryParse(label1.Text, out l1)) throw new ArgumentException("Label 1 needs to be numeric");
label1.Text = (d1 + d2 + l1).ToString();


这篇关于如何在标签和下一个按钮中添加两个文本框值单击Label + Txt1 + Txt2?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆