sábado, 28 de septiembre de 2013

Control CheckBox

Descripción

El control CheckBox se utiliza generalmente para listar opciones y que el usuario pueda elegir entre ellas, y dependiendo del valor (si está activado o no), se realiza una u otra acción.
A continuación realizaremos un aplicación donde permite entender mejor acerca de estos controles.

Public Class Form1

    Private Sub btnMostrar_Click(sender As Object, e As EventArgs) Handles btnMostrar.Click
        'Declaramos una variable de tipo entero para cotabilizar la cantidad de checkbox  activados
        Dim Cant As Integer
        'Si cada uno de los controles estan activados, si es así le sumamos y acumulamos más uno
        If ckbJava.Checked = True Then
            Cant += 1
        End If

        If ckbVisualBasic.Checked = True Then
            Cant += 1
        End If

        If ckbPHP.Checked = True Then
            Cant += 1
        End If

        If ckbASPShishar.Checked = True Then
            Cant += 1
        End If

        If ckbASPNET.Checked = True Then
            Cant += 1
        End If

        If ckbJsp.Checked = True Then
            Cant += 1
        End If
        'Mostramos los datos mediante un mensaje
        MsgBox("Nombre: " + txtNombre.Text & vbNewLine & "Dirección: " + txtDireccion.Text & vbNewLine & "Edad: " + txtEdad.Text & vbNewLine & "Total Cursos Favoritos: " & Cant, MsgBoxStyle.Information, "Information")
    End Sub
End Class

1 comentario:

  1. Best Coin Casino Sites - Bonuses, Software, and Games - Casinoworld
    Find the best 제왕 카지노 Coin Casino Sites in the UK right here! Find the best crypto casino sites in the UK, offering top bonuses, games, promotions, 🏆 Best Coin Casino: 인카지노 BitStarz Casino🎲 #1 Crypto Gambling Site: kadangpintar BitStarz Casino💳 Best Bitcoin Casino: BitStark Casino

    ResponderEliminar