我在Form_Load中设置textBox1.Focus();打开窗口后焦点自动聚焦textBox2上,使用select方法才能聚焦到textBox1上,请问这是怎么回事呢?
Hi,
Thank you for posting MSDN forum.
我们应该明白 focus函数和 select函数的区别。
focus函数是设置焦点到某个控件上。
select函数是激活某个控件。两种是不同的。
Focus is a low-level method intended primarily for custom control authors. Instead, application programmers should use the
Select method or the
ActiveControl property for child controls, or the
Activate method for forms.
Best Regards,
Hart
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. Click HERE to participate
the survey.