Visual Basic.NET - Problemas con una Clase....

   
Vista:

Problemas con una Clase....

Publicado por ICC Jairo A. Segura Morales  (3 intervenciones) el 19/04/2010 18:36:58
Que tal:

Ahora tengo otra duda y un problema que no se que sera, hice una clase llamada clsHijo que hereda de Form, segun yo y desde mi punto de vista todo parece estar bien. Pero cuando creo otra clase que hereda de clsHijo no puedo ver ese form en tiempo diseño me muestra el siguiente mensaje:

Constructor on type 'RJ_Radio_Control_2010.clsHijo' not found.

en tiempo de ejecucion todo corre OK compila la clase hace lo que debe hacer pero.... no me late que haga eso pues algo debe estar mal y no quisiera correr riesgos pongo el codigo de mi clase y abajo el otro formulario que hereda de clsHijo saludos y espero alguien pueda orientarme

Imports System.Drawing
Imports System.Windows.Forms

Public Class clsHijo
Inherits Form

#Region "Constructor de la Clase"

Public Sub New(ByVal Titulo As String, ByVal Padre As Form, ByVal Nombre As String)
MyBase.New()
'Texto del Formulario
Text = Titulo
'Quitamos los caja de controles del formulario
ControlBox = False
'Evitamos que el formulario cambie de tamañoo
FormBorderStyle = FormBorderStyle.FixedSingle
'Indicamos el padre
MdiParent = Padre
'Indicamos su nombre
Name = Nombre
'Mostramos la ventana
Show()
End Sub
#End Region

#Region "Funciones y Metodos"

Protected Sub Agrega_TextBox(ByVal Control As TextBox, ByVal Tamano_Fuente As Short, ByVal Ancho As Short, ByVal Alto As Short, ByVal X As Short, ByVal Y As Short, ByVal Mensaje As String)
With Control
.BackColor = Color.Black
.Font = New Font("Alpine 7558M", Tamano_Fuente, FontStyle.Regular, GraphicsUnit.Point, CType(0, Byte))
.ForeColor = Color.GreenYellow
.Location = New Point(X, Y)
.Size = New Size(Ancho, Alto)
.Text = Mensaje
.TextAlign = HorizontalAlignment.Center
.ReadOnly = True
End With
Controls.Add(Control)
End Sub

Protected Sub Agrega_Label(ByVal Control As Label, ByVal Tamano_Fuente As Short, ByVal X As Short, ByVal Y As Short, ByVal Mensaje As String, ByVal Negrita As FontStyle)
With Control
.AutoSize = True
.BackColor = Color.Transparent
.Font = New Font("Microsoft Sans Serif", Tamano_Fuente, Negrita, GraphicsUnit.Point, CType(0, Byte))
.ForeColor = Color.SteelBlue
.Location = New Point(X, Y)
If Mensaje.Trim <> "" Then .Text = Mensaje
End With
Controls.Add(Control)
End Sub

Protected Sub Agrega_Combo(ByVal Control As ComboBox, ByVal X As Short, ByVal Y As Short, ByVal Ancho As Short, ByVal Consulta As String)
With Control
.DropDownStyle = ComboBoxStyle.DropDownList
.ForeColor = Color.SteelBlue
.Items.Add("Programa")
.Location = New Point(X, Y)
.SelectionStart = 1
.Width = Ancho
End With
Controls.Add(Control)
End Sub
#End Region

#Region "Eventos"
Private Sub clsHijo_FormClosed(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
'Guardamos el valor left de la Ventana en el Registro de Windows
SaveSetting("RJ Radio Control 2010", Name, "X", Left)
'Guardamos el valor top de la Ventana en el Registro de Windows
SaveSetting("RJ Radio Control 2010", Name, "Y", Top)
End Sub

Private Sub clsHijo_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
'Establecemos la ubicacion del Formulario
Location = New Point(Val(GetSetting("RJ Radio Control 2010", Name, "X", Left)), Val(GetSetting("RJ Radio Control 2010", Name, "Y", Top)))
End Sub
#End Region

Private Sub InitializeComponent()
Me.SuspendLayout()
'
'clsHijo
'
Me.ClientSize = New System.Drawing.Size(284, 262)
Me.Name = "clsHijo"
Me.ResumeLayout(False)

End Sub

--------------------------------------------------------------------------

Imports System.Drawing
Imports System.Windows.Forms

Public Class clsShots
Inherits clsHijo

#Region "Declaracion de Variables y Controles"

#Region "Variables"

#End Region

#Region "Controles"
Friend WithEvents btnRewind As New clsBotonPlayer(30, 28, 1, 22, "a")
Friend WithEvents btnPlay As New clsBotonPlayer(60, 28, 32, 22, "b")
Friend WithEvents btnStop As New clsBotonPlayer(30, 28, 93, 22, "c")
Private btnShots(20) As clsBotonPlayer
Friend WithEvents cboCatalogo As New ComboBox
Friend WithEvents lblCatalogo As New Label
Friend WithEvents txtDisplay As New TextBox
Friend WithEvents txtTimer As New TextBox
#End Region
#End Region

#Region "Constructor de la clase"

Public Sub New(ByVal Titulo As String, ByVal Padre As System.Windows.Forms.Form)
'Creamos un nuevo formulario Mixer
MyBase.New(Titulo, Padre, "Shots")
'Inicializamos los controles
InitializeComponent()
End Sub
#End Region

#Region "Funciones y Métodos"

Private Sub InitializeComponent()
'Establecemos propiedades adecuadas para el formulario
ClientSize = New Size(261, 130)
ResumeLayout(False)
PerformLayout()
'Agregamos los controles al Formulario
Agrega_TextBox(txtDisplay, 10, Width, 25, 0, 0, "Prueba.wav")
Agrega_TextBox(txtTimer, 14, 90, 25, (Width - 94), 20, "00:00:000")
Agrega_Label(lblCatalogo, 8, 0, 53, "Seleccionar catálogo:", FontStyle.Bold)
Agrega_Combo(cboCatalogo, lblCatalogo.Width, 53, Width - (lblCatalogo.Width + 4), "Select * From TbCatalogos")
Controls.Add(btnRewind)
Controls.Add(btnPlay)
Controls.Add(btnStop)

Dim Xcord As Short = 1
Dim Ycord As Short = 75
For i = 0 To 19
If i = 10 Then
Xcord = 1
Ycord = 103
End If
btnShots(i) = New clsBotonPlayer(25, 25, Xcord, Ycord, i.ToString)
Xcord += 26
Controls.Add(btnShots(i))
Next
End Sub
#End Region
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder