WF数字计算6
来源:互联网 发布:手机淘宝微淘群在哪里 编辑:程序博客网 时间:2024/05/29 12:24
using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;namespace 数字和计算器{ public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { string str1 = textBox1.Text;//取textBox1的值; string str2 = textBox2.Text;//取textBox2的值; int m1, m2; if(!int.TryParse(str1,out m1)) { // MessageBox.Show = "您好";//此种形式的是一个属性; MessageBox.Show("第一个数不是合法整数");//调用MessageBox的方法 return;//如果第一个出错就不能在继续执行下去了,必须要return退出函数 } if (int.TryParse(str1, out m2)==false)//等价与!int,TryParse(str1,out m1) { MessageBox.Show("第二个数不是合法整数"); return; } int m3 = m1 + m2; textBox3.Text = Convert.ToString(m3);//等价于 textBox3.Text=m3.ToString(); } }}
0 0
- WF数字计算6
- WF
- wf
- 数字计算
- 数字计算
- WF 系列--WF基础
- VBA中数字计算
- 计算一个数字位数
- shell 的数字计算
- 计算数字之和
- 页码数字计算
- js数字计算
- 计算加法数字
- 计算机的数字计算
- 数字计算问题
- 数字计算格式问题
- 计算特殊数字
- 坚持学习WF(6):开发可复用的宿主程序
- get post 区别
- poj 1743(后缀数组)
- jquery排除某个元素
- hibernateTemplte 问题
- 如何在java中实现List集合的遍历
- WF数字计算6
- 系统服务启动tomcat报错,特定错误代码1
- POJ 2105解题报告
- 搜狗2016年校招笔试编程题记录+总结
- 数据结构考研复习--线性表3(约瑟夫环)
- SQLite数据库
- 属性操作
- WF索引器7
- iOS学习: 系统相机 相册的调用