如何设置哪些控件有焦点在应用程序启动 [英] How to set which control has focus on Application start

查看:107
本文介绍了如何设置哪些控件有焦点在应用程序启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在C#/的WinForms如何设置默认的焦点时,我的应用程序启动?

In C#/Winforms how do I set the default focus when my application starts?

推荐答案

用最小的标签所述一个指数自动获得焦点(假设接受tab 属性设置为true)。只需适当地设置选项卡索引。

The one with the minimum tab index automatically gets the focus (assuming the TabStop property is set to true). Just set the tab indices appropriately.

顺便说一句,Visual Studio提供了轻松,只需点击你想要的顺序控制设置制表指数的方法。您可以通过当你在表单设计视图选择在查看菜单中的Tab键顺序选项激活此功能。

By the way, Visual Studio provides a way to easily set tab indices by just clicking on the controls in the order you want. You can activate this feature by choosing "Tab Order" option in the "View" menu when you are in the form design view.

您也可以手动将焦点放到通过调用它的选择方法时加载窗体。

You can also manually give the focus to a control by calling its Select method when the form loads.

这篇关于如何设置哪些控件有焦点在应用程序启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆