当输入文本框中的文本之间有空格时,我的三次单击只会突出显示下一个空格,而不是整个文本框。
klr1opcd1#
订阅DoubleClick事件:
private void textBox1_DoubleClick(object sender, EventArgs e) { textBox1.SelectionStart = 0; // set the selection start index to the beginning textBox1.SelectionLength = textBox1.Text.Length; // set the selection length to the length of the text }
https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.control.doubleclick?view=windowsdesktop-7.0
1条答案
按热度按时间klr1opcd1#
订阅DoubleClick事件:
https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.control.doubleclick?view=windowsdesktop-7.0