C# WINDOW程序问题!

来源:百度知道 编辑:UC知道 时间:2024/05/29 05:17:16
这是一个计算器,输入2个数,然后计算
怎样实现如果没有输入,或只输入1个数,弹出提示并返回让用户输入
sing System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace WindowsApplication2
{
public partial class jeadong : Form
{
public jeadong()
{
InitializeComponent();
}

private void textBox2_TextChanged(object sender, EventArgs e)
{

}

private void btnprint_Click(object sender, EventArgs e)
{

int n = int.Parse(txtRow.Text);
int j = int.Parse(txtcheng.Text);

int s = n * j;

txtPic.Text = s.ToString();
}

private void button1_Click(object sender, EventArgs e)
{
double n=double.Pa

if(text1.text=""||text2.text="")
messagebox("警告!");
text1.focus();

if (txtRow.Text.Length==0 || txtcheng.Text.Length == 0)
{
MessageBox.Show("输入信息不完整,请重新输入");
}