Public Class CargarDatosAlumnos
Private Sub CargarDatosAlumnos_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles MyBase.Load
End Sub
Private Sub ComboBox7_SelectedIndexChanged(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles ComboBox7.SelectedIndexChanged
'aquí iria rutina de ocultamiento que pretendo
'dim i as Integer = 0
'for i = 9 to 13 (para ocultar desde el ComboBox9 al ComboBox13 actuales)
'combobox[i].Visible = False
'next
'la rutina anterior reemplaza toda la porción de codigo que sigue, a la que
'le falta agregar otros 10 o 12 ComboBox que con la rutina anterior solo
'debería modificar el lazo for a 25 (for i = 9 to 25)
If ComboBox7.SelectedItem <> "Argentina" Then
ComboBox9.Visible = False
ComboBox10.Visible = False
ComboBox11.Visible = False
ComboBox12.Visible = False
ComboBox13.Visible = False
ComboBox10.Visible = False
ComboBox11.Visible = False
ComboBox12.Visible = False
ComboBox13.Visible = False
'debo seguir agregando ComboBox hasta el ComboBox25 aproximadamente
Label29.Visible = False
Label35.Visible = False
Label30.Visible = False
Label12.Visible = False
End If
If ComboBox7.SelectedItem = "Argentina" Then
Label35.Visible = False
Label37.Visible = False
ComboBox6.Visible = True 'hace visible el ComboBox que permite seleccionar las provincias Argentinas
ComboBox6.SelectedIndex = 0
ComboBox6.Location = New Point(237, 215) 'pone el combobox en la posición de pantalla
Label11.Visible = True 'hace visible el Label título del ComboBox
Label11.Location = New Point(297, 199) 'pone el label en la posición de pantalla
Exit Sub
Else
ComboBox6.Visible = False
Label11.Visible = False
End If
If ComboBox7.SelectedItem = "Bolivia" Then
Label37.Visible = True
Label37.Location = New Point(285, 199)
TextBox4.Visible = True
TextBox4.Location = New Point(237, 215)
Exit Sub
Else
Label37.Visible = False
TextBox4.Visible = False
End If
If ComboBox7.SelectedItem = "Brasil" Then
Label37.Visible = True
Label37.Location = New Point(285, 199)
TextBox4.Visible = True
TextBox4.Location = New Point(237, 215)
Exit Sub
Else
Label37.Visible = False
TextBox4.Visible = False
End If
If ComboBox7.SelectedItem = "Chile" Then
Label37.Visible = True
Label37.Location = New Point(285, 199)
TextBox4.Visible = True
TextBox4.Location = New Point(237, 215)
Exit Sub
Else
Label37.Visible = False
TextBox4.Visible = False
End If
If ComboBox7.SelectedItem = "Paraguay" Then
Label37.Visible = True
Label37.Location = New Point(285, 199)
TextBox4.Visible = True
TextBox4.Location = New Point(237, 215)
Exit Sub
Else
Label37.Visible = False
TextBox4.Visible = False
End If
If ComboBox7.SelectedItem = "Uruguay" Then
Label37.Visible = True
Label37.Location = New Point(285, 199)
TextBox4.Visible = True
TextBox4.Location = New Point(237, 215)
Exit Sub
Else
Label37.Visible = False
TextBox4.Visible = False
End If
If ComboBox7.SelectedItem = "Otro País -indicar-" Then
TextBox4.Visible = True
TextBox4.Location = New Point(237, 215)
Label12.Visible = True
Label12.Location = New Point(252, 199)
Exit Sub
Else
TextBox4.Visible = False
Label12.Visible = False
End If
End Sub
Private Sub ComboBox6_SelectedIndexChanged(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles ComboBox6.SelectedIndexChanged
If ComboBox6.SelectedItem = "Buenos Aires" Then
ComboBox9.SelectedIndex = 0
ComboBox9.Visible = True
ComboBox9.Location = New Point(470, 216)
Label29.Visible = True
Label29.Location = New Point(490, 199)
Exit Sub
Else
ComboBox9.Visible = False
Label29.Visible = False
End If
If ComboBox6.SelectedItem = "Ciudad Autónoma de Buenos Aires" Then
Label35.Visible = False
Label29.Visible = False
ComboBox10.SelectedIndex = 0
ComboBox10.Visible = True
ComboBox10.Location = New Point(470, 215)
Label30.Visible = True
Label30.Location = New Point(490, 199)
Exit Sub
Else
ComboBox10.Visible = False
Label30.Visible = False
End If
If ComboBox6.SelectedItem = "Catamarca" Then
ComboBox11.SelectedIndex = 0
ComboBox11.Visible = True
ComboBox11.Location = New Point(470, 215)
Label35.Visible = True
Label35.Location = New Point(530, 199)
Exit Sub
Else
ComboBox11.Visible = False
Label30.Visible = False
End If
If ComboBox6.SelectedItem = "Chaco" Then
ComboBox12.SelectedIndex = 0
ComboBox12.Visible = True
ComboBox12.Location = New Point(470, 215)
Label35.Visible = True
Label35.Location = New Point(530, 199)
Exit Sub
Else
ComboBox12.Visible = False
Label35.Visible = False
End If
If ComboBox6.SelectedItem = "Corrientes" Then
ComboBox13.SelectedIndex = 0
ComboBox13.Visible = True
ComboBox13.Location = New Point(470, 215)
Label35.Visible = True
Label35.Location = New Point(530, 199)
Exit Sub
Else
ComboBox13.Visible = False
Label35.Visible = False
End If
If ComboBox6.SelectedItem = "Entre Rios" Then
ComboBox14.SelectedIndex = 0
ComboBox14.Visible = True
ComboBox14.Location = New Point(470, 215)
Label35.Visible = True
Label35.Location = New Point(530, 199)
Exit Sub
Else
ComboBox14.Visible = False
Label35.Visible = False
End If
If ComboBox6.SelectedItem = "Chubut" Then
ComboBox15.SelectedIndex = 0
ComboBox15.Visible = True
ComboBox15.Location = New Point(470, 215)
Label35.Visible = True
Label35.Location = New Point(530, 199)
Exit Sub
Else
ComboBox15.Visible = False
Label35.Visible = False
End If
End Sub
End Class