我是这样的代码,奇怪的是可以运行处登录界面,但是任何一个按钮点击都没反应,包括回车!
能否帮我看看?
using System;
using System.Collections.Generic;
using
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace gkshjd
{
public partial class frm_login : Form
{
public frm_login()
{
InitializeComponent();
txtuser.Focus();
}
private void Form1_Load(object sender, EventArgs e)
{
txtuser.Focus();
}
private void txtuser_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == 13)
{
txtpwd.Focus();
}
}
private void txtPwd_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == 13)
{
btnsubmit_Click(sender, e);
}
}
private void btnsubmit_Click(object sender, EventArgs e)
{
if (MessageBox.Show("确定退出系统吗?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Asterisk) == DialogResult.OK)
{
Application.Exit();
}
}
private void btnexit_Click(object sender, EventArgs e)
{
if (MessageBox.Show("确定退出系统吗?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Asterisk) == DialogResult.OK)
{
Application.Exit();
}
}
}
}
[
本帖最后由 zjdjh 于 2012-3-12 18:55 编辑 ]