Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

296
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda