xml - 如何在自定义 XML 功能区中水平集中控件
问题描述
在一个组内,我在第一行添加了一个带有标签 + 按钮的编辑框。下面,我添加了 4 个导航按钮。我需要的是在编辑框和绿色按钮下水平集中这 4 个导航按钮。
我尝试了很多方法。我最后一次尝试是在 4 个按钮之前放置一个空框,然后在之后放置一个空框,但未成功。在最后一次尝试中,发生的情况是 4 个导航按钮先出现,然后是空框,如下图所示。
我还想将所有控件(编辑框和绿色按钮 + 4 个导航按钮)放在功能区的底部。
我知道有一篇文章讨论了该属性的使用,boxStyle="horizontal"
但是,我正在使用该属性,但没有成功。
代码:
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
<ribbon startFromScratch="true">
<tabs>
<tab id="tab0" label="Controles">
<group id="grp0" label="Navegação">
<box id="box0" boxStyle="vertical">
<box id="box2" boxStyle="horizontal">
<editBox id="ebx13" label="Ir para" screentip="Campo Ir Para..." supertip="Digite o número ID do documento desejado e aperte o Botão ao lado."/>
<button id="btn14" size="normal" screentip="Botão Ir Para..." supertip="Carrega a tela com o documento desejado." imageMso="AnimationStartDropdown"/>
</box>
<box id="box4" boxStyle="horizontal">
<box id="box5"> </box>
<box id="box1" boxStyle="horizontal">
<button id="btn0" size="normal" screentip="Botão Ir para o Primeiro Registro" supertip="Carrega a tela com o primeiro registro salvo." imageMso="RewindLong"/>
<button id="btn1" size="normal" screentip="Botão Ir para o Registro Anterior" supertip="Carrega a tela com o registro anterior ao atual." imageMso="CatalogMergeGoToPreviousRecord"/>
<button id="btn2" size="normal" screentip="Botão Ir para o Próximo Registro" supertip="Carrega a tela com o próximo registro ao atual." imageMso="CatalogMergeGoToNextRecord"/>
<button id="btn3" size="normal" screentip="Botão Ir para o último Registro" supertip="Carrega a tela com o último registro salvo." imageMso="FastForwardLong"/>
</box>
<box id="box6"> </box>
</box>
</box>
</group>
<group id="grp2" label="Registros">
<box id="box3" boxStyle="horizontal">
<button id="btn4" size="large" label="Novo" screentip="Botão Novo Registro" supertip="Cria um novo documento." imageMso="AddAccount"/>
<button id="btn5" size="large" label="Duplicar" screentip="Botão Duplicar Registro" supertip="Cria um novo documento aproveitando os dados do documento carregado na tela. O ID desse novo documento será; novo." imageMso="AdpStoredProcedureQuerySelect"/>
<button id="btn6" size="large" label="Editar" screentip="Botão Editar Registro" supertip="Altera os dados do documento carregado na tela." imageMso="IconPencilTool"/>
<button id="btn7" size="large" label="Excluir" screentip="Botão Excluir Registro" supertip="Exclui o documento carregado na tela." imageMso="ChangeToDeclineInvitation"/>
</box>
</group>
</tab>
</tabs>
</ribbon>
</customUI>
提前致谢。
解决方案
几天前,我找到了一种水平集中控制的方法。我通过<labelControl id="label1" label=" "/>
在要集中的控件之前插入 a 并在标签属性中尽可能多地写入空格来实现所需的结果。
<box id="box2" boxStyle="horizontal">
<labelControl id="label1" label=" "/>
<box id="box3" boxStyle="horizontal">
<button id="btn1" size="normal" screentip="Botão Ir para o Primeiro Registro" supertip="Carrega a tela com o primeiro registro salvo." imageMso="RewindLong"/>
<button id="btn2" size="normal" screentip="Botão Ir para o Registro Anterior" supertip="Carrega a tela com o registro anterior ao atual." imageMso="CatalogMergeGoToPreviousRecord"/>
<button id="btn3" size="normal" screentip="Botão Ir para o Próximo Registro" supertip="Carrega a tela com o próximo registro ao atual." imageMso="CatalogMergeGoToNextRecord"/>
<button id="btn4" size="normal" screentip="Botão Ir para o último Registro" supertip="Carrega a tela com o último registro salvo." imageMso="FastForwardLong"/>
</box>
</box>
结果如下图所示:
也许有更好的方法来获得它。
谢谢。
推荐阅读
- typescript - 在对象的联合上选择属性时获取对象的联合
- excel - 如何将“条件格式>图标集”中的图标添加到单个单元格?
- azure - SSH 私钥存储在 Azure 中的什么位置?
- r - R使用Purrr Map函数计算KMeans模型的轮廓距离
- java - 我们可以避免将所有字段映射到springdata中的实体类以进行弹性搜索,因为我在json文档中有100多个字段吗?
- node.js - 为什么 make-promises-safe 仅用于“在顶级程序代码中”
- javascript - ReferenceError:虽然我使用的是 puppeteer,但未定义文档
- python - 过滤 pytest 固定装置
- git - 如何在没有快进的情况下取消合并和重新合并?
- python - 无法将 CustomModel 分配给 QQmlListModel