列表控件内的组合框? (非托管 C++)
我正在使用非托管 C++,我想知道是否可以在列表视图的列中嵌入组合框。我尝试过在谷歌上搜索信息,但我一直在寻找有关该主题的 C# 文章。
LVCOLUMN 的掩码似乎可以支持文本和图像,但我没有找到任何有关控件的信息。
关于这个主题的任何想法都会很棒。
I'm using unmanaged C++ and I was wondering if I could embed a combo box inside a column of my List View. I have tried googling for information, however I keep finding C# articles on the subject.
It seems like the LVCOLUMN's mask can support text and images but I am not finding anything about controls.
Any ideas on the subject would be great.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以创建一个浮动组合框并将其放置在列表控件的选定行和列上。您需要捕获列表控件上所有与选择相关的操作,并显示、隐藏或移动和更新组合框的内容。
You can create a floating combo box and position it over the selected row and column of the list control. You'll need to trap all selection related operations on the list control and show, hide, or move and update the contents of the combo box.
您还可以查看一些允许这样做的第三方控件(默认的 MS 通用控件并不真正支持它)。例如,Ultimate Grid 允许此类操作。它没有得到很好的支持,但它是开源的,所以如果没有别的办法,它可能会为构建它所涉及的内容提供一些参考。
可能还有其他商业供应商提供这些控件,但我不会特别推荐任何东西(您可以随时谷歌/等)。
You could also look at some 3rd party controls which allow this (it's not really supported in the default MS common controls). For example, the Ultimate Grid allows this sort of thing. It's not well supported, but it is open source, so if nothing else it might provide some reference for what would be involved in building it.
There are probably also other commercial vendors for these controls, but I'm not going to recommend anything in particular (you can always google/etc.).
我最近正在研究这个。如果您希望它适合正确的空间,那么据我所知,您唯一的选择是创建您自己的组合框控件。这并不难做并且效果很好:)
I was looking into this recently. If you want it to fit into the correct space then your only option, as far as i could work out, is to create your own combo box control. Its not difficult to do and gives good results :)