LibreOffice Base;制表符顺序从主窗体到子窗体 [英] LibreOffice Base; Tab order from mainform to subform

查看:291
本文介绍了LibreOffice Base;制表符顺序从主窗体到子窗体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有主窗体和子窗体的窗体.当用户位于最接近子窗体的文本框中,并且用户按Tab时,它必须跳到子窗体中,但不是.子窗体之后,它跳到文本框.当用户位于主窗体的最后一个文本框中,然后按Tab键时,它将跳到子窗体中.

I have a form with a mainform and a subform. When the user is in the textbox, which is the closest to the subform, and the user press Tab, it has to jump into the subform, but it doesn't. It jumps to the textbox AFTER the subform. When the user is in the last textbox of the mainform and te user press tab, then it jumps into the subform.

我如何确保用户在文本框(最接近子窗体)中时会跳转到该子窗体?

How do I make sure, that the user will jump to the subform when he is in the textbox, which is the closest one to the subform?

示例图片:

推荐答案

制表符顺序不能解释子窗体上的控件,但这可以通过编程来完成.在When losing focus Event上为与子窗体上的网格/表控件最接近的控件设置LO Basic宏.这是一个控件,当您单击它时,您想转到网格.对于该事件,运行这样的宏,其中grid1是表/网格控件:

Tab order in the UI does not account for controls on subforms, but this can be done programmatically. Set a LO Basic macro on the When losing focus Event for the control that is closest to the grid/table control on the subform. That is the control that, when you tab past it, you want to go to the grid. For that event, run a macro like this, where grid1 is the table/grid control:

root_doc = ThisComponent
form_container = root_doc.Drawpage.Forms
form_ctrlr = root_doc.getCurrentController()
sub_frm = form_container.getByName("Sub_Form")
tab_target = sub_frm.getByName("grid1")

form_ctrlr.getControl(tab_target).setFocus()

grid1保留为以下位置时,您还需要设置一个类似的宏,因为它位于子窗体中,因此按制表符顺序不予考虑.

You also will need to set up a similar macro when leaving grid1 as, because it is in the subform, it is not accounted for in the tab order.

probe1 @ ooForum 查看全文

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