Windows Mobile,如何重写ComboBox? [英] Windows Mobile, How to rewrite the ComboBox?
本文介绍了Windows Mobile,如何重写ComboBox?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我们知道,ComboBox的下拉列表的大小是固定的,因此我想将listview或datagrid放入组合框的下拉列表中.
但是我发现Windows.Forms.dll中不包含ToolStripControlHost和ToolStripDropDown.
那我该怎么办?请帮我 !
非常感谢.
As we know, the size of the dropdownlist of the ComboBox is fixed, so I want to put a listview or datagrid into the droplist of the combobox.
But I found the ToolStripControlHost and ToolStripDropDown are not included in the Windows.Forms.dll.
So what can I do? Please Help me !
Thank you very much.
推荐答案
您可以使用Form.Controls集合在运行时添加新的ListView/DataGridView对象. ComboBox还具有一个OnDropDown事件(如果我没记错的话),您可以将其挂接并显示它.
然后在Leave事件上或选择之后,再次使其不可见,将其从Form.Controls和Dispose()
You can use the Form.Controls collection to add a new ListView/DataGridView object at runtime. The ComboBox also has a OnDropDown event (if I remember correctly), that you can hook to position and show it.
Then on the Leave event or after a selection, make it invisible again, remove it from the Form.Controls and Dispose()
这篇关于Windows Mobile,如何重写ComboBox?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文