【发布时间】:2011-03-05 04:52:07
【问题描述】:
我尝试过这样的事情:
var attrs = typeof(System.Windows.Controls.ComboBox).GetCustomAttributes(typeof(System.Drawing.ToolboxBitmapAttribute), true);
...但是 attrs 是空集合。我还尝试在程序集中查找图标资源,但没有找到。
【问题讨论】:
我尝试过这样的事情:
var attrs = typeof(System.Windows.Controls.ComboBox).GetCustomAttributes(typeof(System.Drawing.ToolboxBitmapAttribute), true);
...但是 attrs 是空集合。我还尝试在程序集中查找图标资源,但没有找到。
【问题讨论】:
我猜大多数 WPF 标准控件的图标都包含在 Visual Studio 图像库中: https://msdn.microsoft.com/en-us/library/ms246582.aspx
【讨论】:
那是因为 ComboBox 类是实际的运行时类,它没有这样的属性。您需要找到设计时类。我简要浏览了一些 WPF 程序集,但找不到。
【讨论】: