例如,下面是一个从 ToolboxItemAttribute 派生的简单属性:
<ToolboxItemX(False)> _
Public Class Class1
Inherits Button
End Class
Public Class ToolboxItemXAttribute
Inherits ToolboxItemAttribute
Public Sub New(ByVal defaultType As Boolean)
MyBase.New(defaultType)
End Sub
End Class
问题是当我显示工具箱时,Class1 出现在其中。就好像我的属性被忽略了,所以使用了默认的 toolboxitem 属性。
我已经使用反射器来查看 ToolboxService.GetToolboxItem 的逻辑,据我所知,它应该获取我的属性并看到该项目不应该显示在工具箱中。
PS:我试过重置工具箱,关闭ide并重新打开等。