这是一个c#窗体应用程序,编写简单的窗体程序实现简单的信息保存和读取
usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Da...
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 WindowsFormsApplication7
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void btton1_Click(object sender, EventArgs e)
{
MessageBox.Show("已保存");
}
private void button2_Click(object sender, EventArgs e)
{
MessageBox.Show("{0}",textBox1);
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
if (textBox1.Text.Trim() == string.Empty)
{
MessageBox.Show("数据为空,请重新输入");
textBox1.Focus();
}
}
}
}
我想把textBox1输入的数字保存给button1,然后点button2的时候会读取出textBox1的数字,下面该怎么弄,新手在线等,谢谢! 展开
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication7
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void btton1_Click(object sender, EventArgs e)
{
MessageBox.Show("已保存");
}
private void button2_Click(object sender, EventArgs e)
{
MessageBox.Show("{0}",textBox1);
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
if (textBox1.Text.Trim() == string.Empty)
{
MessageBox.Show("数据为空,请重新输入");
textBox1.Focus();
}
}
}
}
我想把textBox1输入的数字保存给button1,然后点button2的时候会读取出textBox1的数字,下面该怎么弄,新手在线等,谢谢! 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询