Aprende a programar en Visual Basic gratis ,rapido y facil con videotutoriales ,cursos escritos ,ejercicios ,ejemplos y codigo fuente que te ayudaran en tu aprendizaje .Cursos de vb.net y visual basic 6 programacion basica , intermedia y avanzada .Aprende de forma interactiva y dinamica con ejemplos sencillos .Curso visual basic esta orientado a escolares , universitarios y profesionales .
En este nuevo curso de visual studio veremos el uso de el picture box su funcion principal es la de mostrar imagenes vamoa a trabajar tambien con el uso de el combobox algo que ya hemos visto anteriormente para este ejercicio seguiremos trabajando con el msn .
Video Curso
Codigo fuente
Private Sub cbestado_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cbestado.SelectedIndexChanged
'SI HE SELECCIONADO DISPONIBLE NOS MUSTRE EL PICTURE BOX DISPONIBLE
If cbestado.SelectedItem = "Disponible" Then pbdisponible.Visible = True pbausente.Visible = False pbocupado.Visible = False pbsinconexion.Visible = False End If
'SI HE SELECCIONADO AUSENTE NOS MUSTRE EL PICTURE BOX AUSENTE
If cbestado.SelectedItem = "Ausente" Then pbausente.Visible = True pbdisponible.Visible = False pbocupado.Visible = False pbsinconexion.Visible = False End If
'SI HE SELECCIONADO OCUPADO NOS MUSTRE EL PICTURE BOX OCUPADO
If cbestado.SelectedItem = "Ocupado" Then pbocupado.Visible = True pbausente.Visible = False pbdisponible.Visible = False pbsinconexion.Visible = False End If
'SI HE SELECCIONADO SINCONEXION NOS MUSTRE EL PICTURE BOX SINCONEXION
If cbestado.SelectedItem = "Aparece sin conexion" Then pbsinconexion.Visible = True pbocupado.Visible = False pbausente.Visible = False pbdisponible.Visible = False End If
ESTE SEGUNDO CODIGO QUE DIO EL ANONIMO ME FUNCIONO PERFECTAMENTE Y ES MAS FACIL DE MANEJAR,Y PUSE LAS LABRAS EN EL COMBOBOX SIN USAR CODIGO ,IGUAL FUNCIONO MUY BIEN GRACIAS ,NO LO LOGRARIA SIN USTEDES...
creo q con este codigo quedaría mejor amigo, y con un solo picture box
ResponderEliminarPrivate Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
If ComboBox1.SelectedItem = "Disponible" Then
PictureBox1.Image = My.Resources.disponible
ElseIf ComboBox1.SelectedItem = "Ausente" Then
PictureBox1.Image = My.Resources.ausente
ElseIf ComboBox1.SelectedItem = "Ocupado" Then
PictureBox1.Image = My.Resources.ocupado
ElseIf ComboBox1.SelectedItem = "Sin Conexion" Then
PictureBox1.Image = My.Resources.sinconexion
End If
End Sub
ESTE SEGUNDO CODIGO QUE DIO EL ANONIMO ME FUNCIONO PERFECTAMENTE Y ES MAS FACIL DE MANEJAR,Y PUSE LAS LABRAS EN EL COMBOBOX SIN USAR CODIGO ,IGUAL FUNCIONO MUY BIEN GRACIAS ,NO LO LOGRARIA SIN USTEDES...
ResponderEliminar