Estou desenvolvendo um programa que deve funcionar em uma form apenas e utilizando o comando de visible false ou verdadeiro para manipular o que o usuário consegue ver alem de location e size para as textbox, entretanto o código está muito pesado por conta disso e demora para trocar de tela provocando travamentos, sou nova nessa linguagem, tem alguma forma de melhorar o desempenho do programa para que ele pare de travar?
Exemplo do código:
private void btnRegisDados_Click(object sender, EventArgs e)
{
this.BackgroundImage = Properties.Resources.Cadastro;
aparecer = 1;
variavel = 1;
txt1.BackColor = Color.Gainsboro;
btncadasDados.Visible = true;
btnLimparDados.Visible = true;
btnMenu1.Visible = true;
btnMenu2.Visible = true;
btnMenu3.Visible = true;
btnMenu4.Visible = true;
btnMenu5.Visible = true;
btnMenuFechar.Visible = true;
pbxMenuFundo.Visible = true;
lbl1.Visible = true;
lbl2.Visible = true;
lbl3.Visible = true;
lbl4.Visible = true;
lblTit.Text = "Registro de Curso";
lbl1.Text = "ID:";
lbl1.Location = new System.Drawing.Point(206, 229);
lbl2.Text = "Carga Horaria:";
lbl2.Location = new System.Drawing.Point(115, 299);
lbl3.Text = "Instrumento:";
lbl3.Location = new System.Drawing.Point(125, 364);
lbl4.Text = "Modo do\n Curso:";
lbl4.Location = new System.Drawing.Point(154, 406);
lbl4.TextAlign = ContentAlignment.MiddleRight;
txt1.Visible = true;
txt1.Size = new System.Drawing.Size(174, 24);
txt1.Location = new System.Drawing.Point(243, 228);
txt2.Visible = true;
txt2.Size = new System.Drawing.Size(255, 24);
txt2.Location = new System.Drawing.Point(243, 298);
txt3.Visible = true;
txt3.Size = new System.Drawing.Size(255, 24);
txt3.Location = new System.Drawing.Point(243, 362);
txt4.Visible = true;
txt4.Size = new System.Drawing.Size(255, 24);
txt4.Location = new System.Drawing.Point(244, 422);
btnRegisDados.Visible = false;
btnRegisEventos.Visible = false;
btnRegisPessoa.Visible = false;
btnVisuDados.Visible = false;
btnCalen.Visible = false;
btnAlterDados.Visible = false;
btnsair.Visible = false;
pcbbarra.Visible = false;
pcbFoto.Visible = false;
rtbinfo.Visible = false;
btnPessoa.Visible = false;
btnEvento.Visible = false;
btnDados.Visible = false;
lblConfirma.Visible = false;
lbl5.Visible = false;
lbl6.Visible = false;
lbl7.Visible = false;
lbl8.Visible = false;
lbl9.Visible = false;
lbl10.Visible = false;
lbl11.Visible = false;
lbl12.Visible = false;
lbl13.Visible = false;
lbl14.Visible = false;
lblTit.Visible = true;
txt5.Visible = false;
txt6.Visible = false;
txt7.Visible = false;
txt8.Visible = false;
txt9.Visible = false;
txt10.Visible = false;
txt11.Visible = false;
txt12.Visible = false;
}
Agradeço desde já pela ajuda.