messagebox
沈小夕 2013-03-08 09:49:09 新手,学习C#才几天
namespace 计算面积
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void compute_Click(object sender, EventArgs e)
{
float start, end;
if (!float.TryParse(text1.Text, out start ))
{
MessageBox.Show("you had write wrong interge,please enter again");
text1.Focus();
text1.SelectAll();
}
if (!float.TryParse(text2.Text, out end))
{
MessageBox.Show("wrong");
text2.Focus();
text2.SelectAll();
}
if (start ==0 || end==0)
{
MessageBox.Show("您输入的数据不完整");
}
float area;
string str;
area = start * end;
MessageBox ("面积为:{0}",area );
}
}
}
最后的那个messagebox有错,要怎么样实现用messagebox输出此效果