using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Test210825
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
//textBox1.LostFocus += TextBox1_LostFocus;
}
int i = 0;
//private void TextBox1_LostFocus(object sender, EventArgs e)
//{
// i++;
// textBox2.Text = i.ToString();
//}
private void textBox1_KeyUp(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
textBox1_Leave(sender, e);
}
}
//替换LostFocus事件
private void textBox1_Leave(object sender, EventArgs e)
{
i++;
textBox2.Text = i.ToString();
}
}
}
08-30
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交