选项卡索引非顶级控件 [英] tab index non toplevel control

查看:73
本文介绍了选项卡索引非顶级控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

I have a form1. Then I have a form2 which is part of controls collection of form1. Of course then form2 is not a toplevel control. I have 2 controls on form1 with proper tabindexes (1,2) and I want to add a control on form2 where tabindex would be 3. Thus i could TAB through these 3 controls...

如何执行?

... Podlesnick ...

... Podlesnick ...

推荐答案

我有一个表格1.然后我有一个form2,它是form1的控件集合的一部分.当然,form2不是顶级的 控制.我在form1上有2个控件,并带有正确的tabindexindex(1,2),并且我想在form2上添加一个tabtab值为3的控件.因此,我可以通过这3个控件进行制表..

I have a form1. Then I have a form2 which is part of controls collection of form1. Of course then form2 is not a toplevel control. I have 2 controls on form1 with proper tabindexes (1,2) and I want to add a control on form2 where tabindex would be 3. Thus i could TAB through these 3 controls..

您不能直接执行此操作.您必须将代码放入带有tabindex 2的控件的Leave事件处理程序中,才能将焦点移到form2上的控件上.但是请注意,干扰Windows中的内置用户界面过程可能会 具有意想不到的副作用.更好的解决方案是重新设计GUI,这样您就无需操纵默认的用户界面处理.有什么理由使您在Form2中拥有的控件必须以某种形式存在? 而不是在面板或类似容器中?

You can't do this directly.  You would have to put code in the Leave event handler for the control with tabindex 2 to move the focus to the control on form2.  But note that interfering with the built-in user interface processes within Windows can have unexpected side effects.   A better solution is to redesign your GUI so that you do not need to manipulate the default user interface handling.   Is there any reason why the controls you have in form2 have to be in a form rather than in a panel or some similar container?


这篇关于选项卡索引非顶级控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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