Amigos, tengo un problemas, he creado una clase para manejar un arreglo de
lable, el problema es que cuando ejecuto el programa no se muestra el label
que agrego a mi form.
Clase:
Public Class clsLblArrays
Inherits System.Collections.CollectionBase
Private ReadOnly HostForm As System.Windows.Forms.Form
Default Public ReadOnly Property Item(ByVal Index As Integer) As
System.Windows.Forms.Label
Get
Return CType(Me.List.Item(Index), System.Windows.Forms.Label)
End Get
End Property
Public Function AddNewLabel() As System.Windows.Forms.Label
Dim aLabel As New System.Windows.Forms.Label
Me.List.Add(aLabel)
aLabel.Location = New Point(24, 140)
aLabel.Text = "Hola Mundo"
aLabel.AutoSize = True
HostForm.Controls.Add(aLabel)
Return aLabel
End Function
Public Sub New(ByVal host As System.Windows.Forms.Form)
HostForm = host
Me.AddNewLabel()
End Sub
End Class
Instacia de la Clase:
Dim lblChapter As clsLblArrays
lblChapter = New clsLblArrays(Me)
lblChapter.AddNewLabel()
Me gustaria en lo que puedan ayudarme o darme algun truco sobre esto.
Leer las respuestas