如何使文本框在C#中突出显示 [英] How to make the textbox to highlight in C#
问题描述
大家好,
当用户输入添加"按钮时,我必须突出显示文本框.文本框在下一页的下一页中,该页应突出显示.我尝试了textbox1.Focus().它只会高亮显示文本框,但要在其中输入文本,用户应单击 鼠标放在上面.我也尝试过
I have to highlight the textbox when the user enters the Add button. The textbox is in nextpage In the next page which should be highlighted. I tried textbox1.Focus(). It will only highlight the textbox, but to enter the text in it, user should click the mouse on it. I also tried
System.Windows.Input.Keyboard.Focus(textbox1);
System.Windows.Input.Keyboard.Focus(textbox1);
您能帮我找出确切的方法吗?
can you please help me to figure out the exact method.
谢谢,
Shilpa
Thx,
Shilpa
推荐答案
textBox1.SelectAll();在文本框中选择所有文本.那是你想做的吗?
textBox1.SelectAll(); with select all text in the textbox. Is that what you want to do?
这篇关于如何使文本框在C#中突出显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!