如何把重点放在文本框,当窗体加载? [英] how to put focus on TextBox when the form load?
本文介绍了如何把重点放在文本框,当窗体加载?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在我的C#程序的textBox
I have in my C# program textBox
我需要在程序开始,重点将放在文本框中
I need that when the program start, the focus will be on the textBox
我试穿一下的Form_Load:
I try this on Form_Load:
MyTextBox.Focus();
但它不会工作。
but it wont work
推荐答案
设置窗体的 ACTIVECONTROL
财产,你应该罚款。
Set theActiveControl
property of the form and you should be fine.
this.ActiveControl = yourtextboxname;
这篇关于如何把重点放在文本框,当窗体加载?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文