第一章 初始Windows程序上机练习1~5
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace MyScgool
{
public partial class frmLogin : Form
{
public frmLogin()
{
InitializeComponent();
}
private void btnCancel_Click(object sender, EventArgs e)
{
DialogResult result= MessageBox.Show("确认要退出吗?", "温馨提示!", MessageBoxButtons.OKCancel,
MessageBoxIcon.Question);
if(result ==DialogResult .OK )
{
this.Close();
}
}
public const string CAPTION="温馨提示";
public bool CheckInput()
{
if (this.textUserName.Text.Trim().Equals(string.Empty))
{
MessageBox.Show("请输入用户名",CAPTION,MessageBoxButtons .OK ,
MessageBoxIcon .Information);
this .textUserName .Focus ();
return false ;
}else if(this .textPwd