Word 2007 功能区 - 正确对齐组中的控件
我无法在 Word 2007 中的自定义功能区中正确对齐组中的控件。
在上面的屏幕截图中,您可以注意到文本框和下拉菜单未正确对齐。以下是我的 CustomUI 功能区 XML:-
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui" onLoad="RibbonLoad">
<ribbon>
<tabs>
<tab id="tabZZZZ" label="ZZZZ">
<group id="grpItems" label="Items">
<dropDown id="ddlQQQ" getItemLabel="qqqq" onAction="rrrr" label="zzzz zzzzz">
<item id="item1" label="item1"/>
</dropDown>
<editBox id="editAAA1" label="AAAAA AAAAA AAAAA" onChange="ZZZ" />
<editBox id="editBBBB" label="BBBB BBBBB BBBBB BBBBB" onChange="BBB" />
<separator id="separator1" />
<editBox id="editCCCC" label="CCCCCC CC CCCCCC CCCC" onChange="CCC" />
<dropDown id="ddlDDD" label="DDDDDDD DDDD DDDDDDDD DDDD" onAction="DDD" getItemLabel="DDD">
<item id="Item1" label="Item1"/>
</dropDown>
<button id="btnEEE" label="EEEEEEEEEEEEEE" onAction="EEEE"/>
</group>
</tab>
</tabs>
</ribbon>
</customUI>
对于如此奇怪的标签名称,我深表歉意。但是,上述 XML 中每个标签的字符数与我使用的实际标签相同。有人可以请建议吗?
I am not able to properly align the controls in a group in custom ribbon in Word 2007.
In the above screenshot you can notice the textboxes and the dropdowns are not properly aligned. Following is my CustomUI ribbon XML:-
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui" onLoad="RibbonLoad">
<ribbon>
<tabs>
<tab id="tabZZZZ" label="ZZZZ">
<group id="grpItems" label="Items">
<dropDown id="ddlQQQ" getItemLabel="qqqq" onAction="rrrr" label="zzzz zzzzz">
<item id="item1" label="item1"/>
</dropDown>
<editBox id="editAAA1" label="AAAAA AAAAA AAAAA" onChange="ZZZ" />
<editBox id="editBBBB" label="BBBB BBBBB BBBBB BBBBB" onChange="BBB" />
<separator id="separator1" />
<editBox id="editCCCC" label="CCCCCC CC CCCCCC CCCC" onChange="CCC" />
<dropDown id="ddlDDD" label="DDDDDDD DDDD DDDDDDDD DDDD" onAction="DDD" getItemLabel="DDD">
<item id="Item1" label="Item1"/>
</dropDown>
<button id="btnEEE" label="EEEEEEEEEEEEEE" onAction="EEEE"/>
</group>
</tab>
</tabs>
</ribbon>
</customUI>
My apologies for such weird names for labels. However, the number of characters in each label in the above XML is same that for the actual labels I am using. Could anyone please advice?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是设计使然,设计界面不支持像 Access 那样的多组件布局。要实现您想要的效果,请尝试以下操作:
作为旁注,您可能需要在下拉列表和/或编辑框中设置
SizeString
以确保它们的宽度一致。This is by-design, the design surface doesn't support multi-component layout like Access. To achieve what you're looking for, try this instead:
As a side note, you may want to set the
SizeString
on your dropdown and/or edit boxes to ensure uniform width across them.