In my WinForms project (VS2010, .NET 4.0) I had a user control named MyView
, which was derived from System.Windows.Forms.UserControl
. Then I modified this control to be Generic User Control:
Partial Class MyView(Of TEntity As {New, Class})
Inherits System.Windows.Forms.UserControl
' source code here
End Class
Unfortunately, auto-generated InitializeComponent()
code from VS Winforms Designer is supplied with vb.net syntax error and produce compilation error:
Dim resources As System.ComponentModel.ComponentResourceManager =
New System.ComponentModel.ComponentResourceManager(GetType(MyView))
Instead of above line of code, there should be:
Dim resources As System.ComponentModel.ComponentResourceManager =
New System.ComponentModel.ComponentResourceManager(GetType(MyView(Of TEntity)))
How can I fix this behavior of VS2010 WinForms Designer?