.NET 3.5 表单 - 插件架构。 - 不同应用程序域中的模块 - TabOrder 不起作用
我正在开发一个完全模块化的应用程序。这些模块位于不同的 .dll 中,并在不同的应用程序域中运行。
模块表单的加载与主机表单没有任何连接(它们不是模态的,也不是拥有的,它们只是显示的实例化变量。
问题是模块表单中的 Tab 顺序完全错误。它们根本不工作或有时相反,我认为所使用的顺序是将控件添加到其容器中的顺序...
我已经在这里找到了对该问题的引用:http://www.pcreview.co.uk/forums/thread-3512493.php
有什么方法可以使此选项卡顺序工作?!
非常感谢您的帮助。
I am developing an application that is totally modular. These modules are in different .dlls and run in different application domains.
The module forms are loaded without any connection with the host form (they are not modal, neither owned, they are just instanciated variables that are shown.
The problem is that the Tab order in the module forms is totally wrong. They simply don't work or are sometimes reversed. I think that the order used is the one in which the controls are added to their container...
I already found a reference to the problem here: http://www.pcreview.co.uk/forums/thread-3512493.php
Is there any way to make this tab order work?!
Thank you very much for your help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是完全正常的。 Tab 键顺序由控件的 TabIndex 属性设置。它从 0 开始,每次添加新控件时都会递增。否则 Winforms 无法猜测您想要不同的顺序。
无需编辑 TabIndex 值,您可以使用 View + Tab Order 快速设置它。您会看到指示当前订单的浅蓝色数字。按照您想要的顺序单击控件。
如果这些控件是在运行时添加的,那么您需要编写代码来正确设置它们的 TabIndex 属性。
This is entirely normal. The tab order is set by the controls' TabIndex property. It starts out at 0 and increments each time you add a new control. Winforms otherwise has no way to guess that you want a different order.
Short from editing the TabIndex values, you can use View + Tab Order to set it quickly. You'll see light blue numbers that indicate the current order. Click the controls in the order you want.
If these controls are added at runtime then it is up to you to write the code to set their TabIndex property correctly.
非常感谢您的回复,但是我已经做了,但还是不行。这是选项卡视图的图像:
编辑:嗯,我无法将图片上传到 http://i.imgur.com 下班。不管怎样,这张图片是 Visual Studio 2010 选项卡视图的屏幕截图,显示了正确设置的选项卡顺序。
我不知道我是否理解正确,但是您是说我应该编写代码来在表单的加载事件上设置选项卡顺序,仅仅因为我手动实例化了表单?
感谢您的帮助。
I thank you very much for your reply, but I already did it and it doesn't work. Here is an image of the Tab View:
EDIT: Well I can't upload a picture to http://i.imgur.com from work. Anyway, the picture was a screenshot from Visual Studio 2010's Tab View showing the tab order corretly set.
I don't know if I understood you correctly, but are you saying that I should write the code to set the tab order on the form's load event, simply because I instanciated the form manually?
Thank you for your help.