如何调整wxcombobox弹出窗口的大小
我使用 wxwidgets C++ 库(使用 MSVC 和 GCC)在对话框上创建了一个组合框。组合框中的项目列表太多,当我单击组合框时,整个列表都会显示在屏幕上,看起来很糟糕,并且从该列表中选择一个项目并不是用户友好的。
无论如何,我们是否可以在带有滚动条的小弹出窗口中看到此列表?我找不到任何相关方法来设置弹出窗口的大小。
任何帮助表示赞赏。
谢谢, 哈里克
I have created a combobox on a dialog using wxwidgets C++ library (with MSVC and GCC). The list of items in the combobox are too many and when I click on the combobox whole list is shown on the screen and it looks bad and choosing an item from this list is not that user frendly.
Is there anyway we can see this list in a small popup window with a scrollbar? I could not find any relevant methods to set the size for popup window.
Any help is appreciated.
Thanks,
Harik
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您是否尝试过在构造函数中设置所需的大小?
像这样,它将弹出窗口的高度限制为 50 像素
Have you tried setting the desired size in the constructor?
Something like this, which will restrict the height of the popup to 50 pixels
您需要将 wxComboCtrl 与一些弹出窗口一起使用(请参阅wxPopupWindow)提供了一个wxListView 和调整大小方法(您可能必须自己实现)。
You need to use wxComboCtrl with some popup window (see wxPopupWindow) that provides a wxListView and a resizing method (you probably have to implement that yourself).