您的位置:首页 > 职场人生

黑马程序员之WinForm编程基础学习笔记:输入宽和高,输出面积。

2012-09-03 08:29 671 查看
---------------------------------------------------
2345王牌技术员联盟、2345王牌技术员联盟、期待与您交流!---------------------------------------------------------

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Windows.Forms;

namespace Test1

{

public partial calss Form1 : Form

{

public Form1()

{

InitialzeComponent();

}

private void button1_Click(object sender, EventArgs e)

{

//输入宽和高,输出面积。

string strlength= textBox1.Text;

string strwidth = textBox2.Text;

int length = Convert.ToInt32(strlength);

int width = Convert.ToInt32(strwidth);

int area = length*width;

MessageBox.Show("面积为:" + area);

}

}

}

---------------------------------------------------
2345王牌技术员联盟、2345王牌技术员联盟、期待与您交流!---------------------------------------------------------









内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐