我有一个具有不同类型值的 System.Windows.Forms.PropertyGrid
。对于特定项目,我想显示一个有用值列表以供选择。用户也可以键入一个新值。类似于传统下拉组合框的东西:
到目前为止,我有自己的 System.ComponentModel.TypeConverter
,但我不知道如何获得带有建议值的下拉列表和直接编辑值。请帮忙!
最佳答案
您可以通过实现自己的 UITypeEditor 来完成此操作.
我推荐阅读 Getting the Most Out of the .NET Framework PropertyGrid Control .特别是标题为 Providing a Custom UI for Your Properties 的部分演练如何为特定属性制作自定义控件。
关于c# - 如何将可编辑的组合框添加到 System.Windows.Forms.PropertyGrid?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9790188/