0
我有这样的代码来选择文本框中的所有文本,如果已经有东西在里面写了(正文长度> 0),它的工作完美的,当我集中使用标签进入这个文本框,然后选择全部或没有,小问题时,重点是通过鼠标点击制作,所以我想波纹管,如果焦点输入由鼠标点击心不是只执行代码,因为如果在文本框的鼠标点击它已经有文字,它会选择所有约0.1秒,并取消选择(但用户可以查看比取消选择后,蓝色选择文本)和它不是好C#WindowsForm - 是如何,如果焦点在文本框中输入检测通过鼠标点击或标签
我的代码:
private void txtValormetrocubico_Enter(object sender, EventArgs e)
{
if (txtValormetrocubico.TextLength > 0)
{
txtValormetrocubico.SelectAll();
}
}
我想做些什么(不正确的语法,只有理解了我的目标)
private void txtValormetrocubico_Enter(object sender, EventArgs e)
{
if (isnt mouse_click)
{
if (txtValormetrocubico.TextLength > 0)
{
txtValormetrocubico.SelectAll();
}
}
}
感谢