办公室中的组合按钮/下拉菜单
如何在 Office 中添加组合按钮/下拉菜单(见下文)。最好有代码。
更新: 如果有帮助,则不需要代码。
How do I add a combination button/dropdown in office (see below). Preferably with code.
Update: If it helps any, code isn't needed.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以这样做,基于以下 ActiveX 控件:
手动,从[控件工具箱]菜单栏中选择“更多控件...”,然后双击提到的控件即可把它们记在你的表上。将 ComboBox 放置在您想要的位置,并忽略 ImageList 的位置,它仅在设计模式下可见。现在您已经有两个名为
的嵌入式控件。这两个组件的插入还会创建对 ...\system32\MSCOMCTL32.OCX 的引用。
然后
现在您有一个出现错误但没有图标的 Combo。
然后你执行这段代码
我已经尽力通过VBA创建对象,但是ImageCombo在创建时似乎表现不同,因为
创建了组合,但是无论我做什么,下拉箭头都不会显示,尽管调试器显示所有ListView 元素整齐地连接在一起。很多同事似乎都对 ActiveX 有问题,网上有很多帖子。
进一步阅读此处
you can do it, based on the following ActiveX controls:
Manually, you select "More Controls..." from the [Control Toolbox] menu bar and double click the mentioned controls to get them on your sheet. Position the ComboBox where you want it to be, and disregard the position of the ImageList, it is visible only in design mode. By now you have two embedded contros named
The insertion of the two components also creates a reference to ...\system32\MSCOMCTL32.OCX.
Then you
By now you have a Combo with the error but no icons.
Then you execute this code
I've tried hard to create the objects by VBA, but the ImageCombo seems to behave different when created as
The combo is created, but the dropdown arrow is not displayed no matter what I do, allthough debugger shows that all ListView elements are neatly attached. Lots of colleagues seem to have problems with that ActiveX, there's loads of posting on the net.
Further reading here