TabStop/TabIndex 在 TableLayoutPanel 中表现不稳定
我有一个相当复杂的 TableLayoutPanel
,上面有近 40 个控件。有些是只读的,有些不需要用户注意,除非在非常特殊的情况下(然后可以用鼠标访问)。因此,我想为这些控件设置 TabStop=false
,并按从上到下、从左到右的顺序排列其余控件。
但是,对于 TableLayoutPanel
内的任何控件,我无法更改 TabStop
属性。也就是说,我可以,但在下次重建时它会重置为 False
。因此,所有控件都可以通过 TAB 键访问,甚至是那些我不想访问的控件。
这是怎么回事?
环境:Windows 7企业版; VS2008; .NET 3.5 SP1;所有控件都直接放置在TableLayouPanel
上,没有中间容器。
添加了更多信息:罗伯特·科尔 (Robert Kerr) 报告说他无法复制。我忘了提及,我在 TableLayoutPanel 上专门使用了 Telerik Winforms RadControls。按钮/复选框似乎工作正常,而文本框、组合框和旋转编辑则不行。
I've got a rather complex TableLayoutPanel
with close to 40 controls on it. Some are read-only, and some don't need user attention unless in very special cases (which can then be accessed with mouse). So I'd like to set TabStop=false
to those controls, and arrange the rest in top-down left-to-right order.
However for any control inside the TableLayoutPanel
I cannot change the TabStop
property. That is, I can, but it gets reset to False
upon the next rebuild. Consequently all controls can be reached by the TAB key, even the ones I don't want to be reachable.
What is going on here?
Environment: Windows 7 Enterprise; VS2008; .NET 3.5 SP1; All controls are placed directly on the TableLayouPanel
, there are no intermediary containers.
Added more info: Robert Kerr reports that he is unable to reproduce. I forgot to mention that I used exclusively Telerik Winforms RadControls on the TableLayoutPanel. It also seems that buttons/checkboxes work fine, while textboxes, comboboxes and spinedits do not.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
需要更多信息。我无法重现该问题。创建一个 TableLayoutPanel,设置为 4 行、4 列,并随机填充按钮、文本框、单选控件、复选框。然后分别设置几个,Tabstop 为 False。反复重建并执行应用程序,它按预期工作。只有 Tabstop 为 True 的控件才能通过 Tab 键访问。 Tabstop 值从未重置为默认值 (true)。
(VS2008、.NET 3.5 SP1、WinSVR2003)
More info required. I was unable to duplicate the problem. Created a TableLayoutPanel, set to 4 rows, 4 columns, and randomly populated with Buttons, TextBoxes, RadioControls, CheckBoxes. Then set on a couple of each, Tabstop to False. Repeatedly rebuilt and executed the application and it worked as expected. Only the controls with True for Tabstop were reachable by tabbing. At no time did the Tabstop value reset to default (true).
(VS2008, .NET 3.5 SP1, WinSVR2003)