Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

300
Vistas
At what point in the Form Load are the Controls created in C# and Visual Basic?

I am migrating a project written in Visual Basic to C#.

During the Load of a Form in VB I execute a function that uses the Controls of said Form and it works correctly.

However, when running the same function during Form Load in C#, the function does not work because it finds 0 Controls. So at what point are Controls created and assigned in VB and C#?

Code in Visual Basic:

New Form

Set Abertura(MiTag) = New aFrmAberturas
        Case 32, 4, 7, 28 ' "VIDRIOS" '"ACRÍLICOS" '"CIEGOS", 28 '"TELA MOSQUITERA"
            Set Abertura(MiTag) = New aFrmManualVi

My function during the Form Load

If Abertura(MiTag).LblRev1(1) = "Tela Mosquit" Then
   .inter1(1, MHA) = "Vidrio Simple"
     cambio = True
 End If      

Controls.Count at the IF

?aModule1.Abertura(MiTag).Count  165 

Code in C#

New Form

aModule1.Abertura[aModule1.MiTag] = new aFrmAberturas();                        
                    break;
                case 32 : case 4 : case 7 : case 28 :  // "VIDRIOS" '"ACRÍLICOS" '"CIEGOS", 28 '"TELA MOSQUITERA" 
                    aModule1.Abertura[aModule1.MiTag] = new aFrmManualVi(); 

My function during the Form Load

if (Convert.ToString(((dynamic) aModule1.Abertura[aModule1.MiTag])._LblRev1_) == "Tela Mosquit")
            {
                aModule1.Vars[aModule1.MiTag].Inter1[1, aModule1.MHA] = "Vidrio Simple";
                cambio = true;
            }

Controls.Count at the IF

aModule1.Abertura[aModule1.MiTag].Controls.Count 0

VB: Here is the Form's declaration

VB: This is my Function during the Form Load, and the Form's Controls.Count

C#: Here is the Form's declaration

C#: This is my Function during the Form Load, and the Form's Controls.Count

over 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda