如何将焦点设置到tabcontainer文本框 [英] How to set the focus to the tabcontainer text box

查看:81
本文介绍了如何将焦点设置到tabcontainer文本框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我在应用程序中使用tabcontainer.在此,我使用了三个选项卡面板,每个选项卡面板都包含许多带有验证控件的文本框.如果任何选项卡中存在任何验证错误,我需要在选项卡面板内为该文本框设置焦点.如何做到这一点.谁能帮我解决这个问题.

在此先谢谢

Hi,

I am using the tabcontainer in my application. In that I am using three tab panels and each tab panel contains lots of text boxes with validation controls. If there was any validation error in any of the tab I need to set the focus for that text boxes inside the tab panels. How to do this one. Can any one help me to solve this problem.

Thanks in Advance

推荐答案

调用Control.Focus来设置键盘焦点.唯一的问题是:它将递归地抛出控件不可见或启用的异常,其父级也是如此.如果使用选项卡控件,请确保选择了适当的选项卡页-使用属性SelectedIndex.

—SA
Call Control.Focus to set keyboard focus. The only problem is: it will throw exception of a control is not visible or enables, same goes for its parent, recursively. In case of tab control, make sure appropriate tab page is selected — use the property SelectedIndex.

—SA


这篇关于如何将焦点设置到tabcontainer文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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