C# textbox快捷键添加横杠
2016-04-02 18:28
295 查看
private void textBoxCinvcode_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.F12)
{
string temp = this.textBoxCinvcode.Text.Trim();
this.textBoxCinvcode.Text = temp + "-";
this.textBoxCinvcode.Select(temp.Length + 1, temp.Length + 1);
}
}
{
if (e.KeyCode == Keys.F12)
{
string temp = this.textBoxCinvcode.Text.Trim();
this.textBoxCinvcode.Text = temp + "-";
this.textBoxCinvcode.Select(temp.Length + 1, temp.Length + 1);
}
}
相关文章推荐