我定义了一个具有泛型类型的类(没问题)。
Public Class clsAbsDatoCodDesc(Of TipoDatoCodigo)
Dim Codigo As TipoDatoCodigo
Dim Descripcion As String
End Class
现在我想在Windows.form中使用此类的参数,但我不能:
dim x as clsAbsDatoCodDesc(Of Integer)
Dim vloFrm As New FrmCodDes10(x)
问题在于表格的定义:
Public Class FrmCodDes10
Dim vmoData As clsAbsDatoCodDesc(Of TipoDatoCodigo)
Public Sub New(ByVal vpoData As clsAbsDatoCodDesc(Of TipoDatoCodigo))
InitializeComponent()
vmoData = vpoData
End Sub
End Class
- 使用abobe代码我得到错误TipoDatoCodigo没有定义,但我无法定义它,因为如果我把:
Public Class FrmCodDes10(Of TipoDatoCodigo)
然后InitializeComponent显示为未定义。