Producto2-3 Programacion

Page 1

[LENGUAJE DE PROGRAMACIÓN I]

27 de mayo de 2014

UNIVERSIDAD TÉCNICA DE AMBATO FACULTAD DE CIENCIAS HUMANAS Y DE LA EDUACIÓN CARRERA DE DOCENCIA EN INFORMÁTICA

CRISTHIAN TAMAMI QUINTO SEMESTRE ING. WILMA GAVILANEZ ABRIL- SEPTIEMBRE 2014

Diseñado por: Cristhian Tamami

Página 1


[LENGUAJE DE PROGRAMACIÓN I]

27 de mayo de 2014

PRODUCTO 2:

LOS OBJETOS DE LA CAJA DE HERRAMIENTAS QUE MANEJA VISUAL PARA SUSTENTAR LAS EL MANEJO DE OBJETOS EN FORMA PERTINENTE.

Visual Studio, se deriva del lenguaje Basic, el cual es un lenguaje de programación estructurado. Sin embargo, Visual Basic emplea un modelo de programación manejada por eventos.

Diseñado por: Cristhian Tamami

Página 2


[LENGUAJE DE PROGRAMACIÓN I]

27 de mayo de 2014

Barra de Menús Presenta los comandos que se usan para trabajar con Visual Basic. Además de los menús estándar Archivo, Edición, Ver, Ventana y Ayuda, contiene otros menús para tener acceso a funciones específicas de programación, como Proyecto, Formato o Depuración.

Barra de Herramientas Permite un acceso directo (solo un clic) a muchas de las operaciones más frecuentes utilizadas durante el desarrollo de aplicaciones. Cuadro de Herramientas Contiene todos los objetos y controles que se pueden añadir a los formularios para crear aplicaciones.

Diseñado por: Cristhian Tamami

Página 3


[LENGUAJE DE PROGRAMACIÓN I]

27 de mayo de 2014

Diseñador de Formularios Funciona como una ventana en la que se puede personalizar el diseño de la interfaz de usuario (ventana) de una aplicación.

Explorador de Proyectos Lista de los archivos (formularios, módulos, etc.) del proyecto actual. Un Proyecto es una colección de archivos que utiliza para construir una aplicación. Ventana de Propiedades

Diseñado por: Cristhian Tamami

Página 4


[LENGUAJE DE PROGRAMACIÓN I]

27 de mayo de 2014

Lista los valores de las propiedades del formulario o control seleccionado que pueden ser modificados durante el diseño del formulario o control.

Ventana de Código Funciona como un editor para escribir el código (sentencias) de la aplicación.

Obtención de Ayuda del Sistema Visual Basic proporciona una variedad de recursos para ayudarle a encontrar la información que necesite cuando se encuentre trabajando dentro del entorno de desarrollo. Ayuda en línea Visual Basic proporciona una amplia ayuda en línea. El archivo de Ayuda contiene mucho código de ejemplo que se puede copiar directamente a una aplicación. La ayuda de Visual Basic es sensible al contexto. Para emplear la ayuda sensible al contexto en la ventana de código, escriba la palabra para la cual desea información, y luego presione F1. Por ejemplo, si desea información acerca de la sentencia Open, escriba Open y presione F1. Libros en Pantalla

Diseñado por: Cristhian Tamami

Página 5


[LENGUAJE DE PROGRAMACIÓN I]

27 de mayo de 2014

Además de la ayuda sensible al contexto, el CD-ROM de Visual Basic incluye una versión en línea de la documentación impresa para Visual Basic. Para acceder a los Libros en Pantalla, haga clic en Libros en Pantalla dentro del menú Ayuda de Visual Basic. La Ventana de Código La ventana o editor de código de Visual Basic proporciona de manera automática información relevante a medida que se ingresa código. Por ejemplo, si se escribe el nombre de un control, seguido de un punto, las propiedades y métodos para ese control serán mostrados automáticamente en un cuadro de lista. Luego se puede escoger la propiedad o método deseado para completar la sentencia.

CONTROLES

Controles Comunes Como se van a dar cuenta, cada control tiene su icono, nombre, prefijo y su descripción. Icono

Nombre

Prefijo

Descripción

Button

btn

Se utiliza para iniciar, detener o interrumpir un proceso.

CheckBox

chk

Muestra una casilla de verificación y una etiqueta para texto. Se utiliza n general para establecer opciones.

CheckedListBox

clb

Muestra una lista desplazable de elementos, cada uno acompañado por una casilla de verificación.

Diseñado por: Cristhian Tamami

Página 6


[LENGUAJE DE PROGRAMACIÓN I]

27 de mayo de 2014

ComboBox

cbo

Muestra una lista desplegable de elementos.

DateTimePicker

dtp

Muestra un calendario gráfico desplegable, que permite que los usuarios seleccionen una fecha o una hora.

Label

lbl

Muestra texto que los usuarios no pueden modificar directamente.

LinkLabel

llbl

Muestra texto en forma de vínculo de estilo Web y desencadena un evento cuando el usuario hace clic en el texto.

ListBox

lst

Muestra una lista de textos, también llamados elementos.

ListView

lstv

Muestra los elementos ya sean texto solo o con gráficos (iconos).

MaskedTextBox

msk

Captura texto escrito por el usuario, ya sea teniendo un formato de entrada.

MonthCalender

mnc

Muestra un calendario gráfico que permite que los usuarios seleccionen un intervalo de fecha

NotifyIcon

nti

Muestra un icono, en el área de notificación de estado de la barra de tareas, que representa una aplicación que se ejecuta en segundo plano.

NumericUpDown

nud

Muestra una lista de número a través de la cual los usuarios se pueden desplazar mediante botones hacia arriba y hacia abajo.

PictureBox

pic

Muestra archivos de imágenes, tales como mapas bits e iconos, gifs, etc.

ProgressBar

pgb

Muestra una barra de progreso, mientras realiza una instrucción.

RadioButton

rdb

Muestra un botón que puede activarse o desactivarse.

RichTextBox

rtb

Habilita la presentación del texto con formato de texto sencillo o de texto enriquecido (RTF).

TextBox

txt

Muestra texto escrito en tiempo de diseño que puede ser editado por los usuarios en tiempo de ejecución.

Diseñado por: Cristhian Tamami

Página 7


[LENGUAJE DE PROGRAMACIÓN I] ToolTip

ttp

27 de mayo de 2014

Este control activa la propiedad ToolTip en los demás controles, su función es brindar una pequeña información al pasar el Mouse por el control que queramos.

TreeView

trv

Muestra una colección jerárquica de objetos de nodo que puede constar de texto con casilla de verificación o iconos opcionales.

WebBrowser

wbr

Permite crear un explorador de Internet con fácil navegación, también se puede abrir múltiples archivos.

Nota: Los prefijos son una referencia, se utiliza para saber de que control se habla en tiempo de diseño, no es obligatorio usarlo, pero es recomendable que se familiaricen, ya que la mayoría de programadores lo usan. Componentes Solo les muestro dos controles, que son los más usados Icono

Nombre

Prefijo

Descripción

ImageList

img

Es un contenedor de imágenes, para que después se use con otros controles.

Timer

tmr

Sirve para realizar un conteo de tiempo, en tiempo de ejecución.

Contenedores Esta categoría se encuentran todos aquellos controles que sirven para contener otros controles. Icono

Nombre

Prefijo

Descripción

FlowLayoutPanel

flp

Es un contenedor de controles que no permite la modificación de la posición del control.

GroupBox

gpb

Agrupa un conjunto de controles (tales como botones de opción) en un marco con etiqueta.

Panel

pnl

Agrupa un conjunto de controles en un marco sin etiqueta que permite el desplazamiento.

SplitContainer

spc

Diseñado por: Cristhian Tamami

Es un contenedor de controles con dos paneles,

Página 8


[LENGUAJE DE PROGRAMACIÓN I]

27 de mayo de 2014

en donde se puede insertar cualquier tipo de control. TabControl

tbc

Proporciona una página con fichas para organizar y tener acceso a controles agrupados de forma eficiente.

TableLayoutPanel

tlp

Es un organizador de controles, ya que podemos añadir filas o columnas para control que queramos.

Datos Como se van a dar cuenta, cada control tiene su icono, nombre, prefijo y su descripción. Icono

Nombre

Prefijo

Descripción

BindingNavigator

bgn

Este control nos permite la navegación de datos, conectada a una base de datos.

BindingSource

bgs

Este control nos permite la conexión y la navegación de datos, de una base de datos.

DataGripView

dgv

Nos permite visualizar los datos de una tabla o de una base de datos.

DataSet

dts

Nos permite la creación y la conexión de una base de datos.

Cuadros de Diálogos Como se van a dar cuenta, cada control tiene su icono, nombre, prefijo y su descripción. Icono

Nombre

Prefijo

Descripción

ColorDialog

cdg

Muestra el cuadro de diálogo de selección de colore, que permite que los usuarios seleccionen el color de un elemento de la interfaz.

FolderBrowserDialog

fbd

Muestra un cuadro de diálogo que permite buscar o una carpeta de destino.

FontDialog

fdg

Muestra un cuadro de diálogo que permite que los usuarios establezcan una fuente y sus atributos.

Diseñado por: Cristhian Tamami

Página 9


[LENGUAJE DE PROGRAMACIÓN I] OpenFileDialog

ofd

27 de mayo de 2014

Muestra un cuadro de dialogo que Permite que los usuarios se desplacen hasta un archivo y lo seleccionen.

SaveFileDialog

sfd

Muestra un cuadro de dialogo que permite que los usuarios guarden un archivo.

Menús y Barras de Herramientas Como se van a dar cuenta, cada control tiene su icono, nombre, prefijo y su descripción. Icono

Nombre

Prefijo

Descripción

ContextMenuStrip

cms

Implementa un menú que aparece cuando el usuario hace clic en un objeto con el botón secundario del Mouse.

MenuStrip

mnu

Proporciona una interfaz en tiempo de diseño para la creación de menús.

StatusStrip

sts

Muestra información acerca del estado actual de la aplicación mediante una ventana con marco, habitualmente en parte inferior de un formulario.

ToolStrip

tls

Contiene una colección de botones, combos, etiquetas, etc.

ToolStripContainer

tsc

Muestra una interfaz de botones con menú.

Propiedades de los Controles Ahora veremos algunas propiedad mas comunes que tienen los controles, solo tocaremos lo que no hemos mencionado, ya que casi todos los controles y formularios tienen las mismas propiedades.

Propiedad

Descripción

AccessKey

Obtiene o establece la clave de acceso (la letra subrayada) que permite desplazarse rápidamente al control de servidor Web.

Anchor

Establece la alineación del control con respecto a un objeto, cuando se maximiza o minimiza.

Attributes

Obtiene la colección de atributos arbitrarios (sólo para procesar) que no corresponden a propiedades del control.

Diseñado por: Cristhian Tamami

Página 10


[LENGUAJE DE PROGRAMACIÓN I]

27 de mayo de 2014

BorderColor

Obtiene o establece el color de borde del control Web.

BorderStyle

Obtiene o establece el estilo del borde del control.

BorderWidth

Obtiene o establece el ancho del borde del control.

FlatStyle

Determina el comportamiento del control, cuando es pasado el Mouse o cuando hacen clic en el control.

Image

Estable la imagen que contendrá el control.

ImageAlign

Establece la alineación de la imagen.

TextAlign

Establece la alineación del texto del control.

ToolTip

Se activa cuando el objeto TooTip esta en el diseño del formulario, normalmente contiene una pequeña información del control.

Métodos Los métodos son casi los mismos que tiene el formulario, así que conforme vamos avanzando veremos uno que otro método propio de cada control. Eventos Los eventos también son muy parecidos a los eventos del formulario, solo tocaremos algunos eventos propios de cada control, conforme avancemos.

PRODUCTO 3: EJERCICIOS DE APLICACIONES PARA SUSTENTAR PRINCIPIOS DE PROGRAMACIÓN Utilizando sentencias condicionantes y repetitivas diseñe los siguientes ejercicios propuestos 1.- PRIMER PROGRAMA: TEMA: OPERACIONES BASICAS ENUNCIADO: Realizar una aplicación que ingresando dos numeros me realice la opcion que pida el usuario. 1. Abrir un nuevo Proyecto en Visual Basic 2. Apariencia del Formulario

Diseñado por: Cristhian Tamami

Página 11


[LENGUAJE DE PROGRAMACIÓN I]

27 de mayo de 2014

ANÁLISIS: Componentes:  FORM Name Form1 Caption (vacio)

Name / Backcolor (plomo-rojo) Font A su gusto (Algerian,20)  LABEL

Backcolor (negro-color)

Cantidad 3

Windowstate Maximize

Name Label1

 BUTTON Cantidad 6

Forecolor (blanco) Caption (vacio)

Name Repetir Backcolor (plomo-rojo)

Name Label2

Font (Algerian,20)

Forecolor (rojo) Caption (vacio)

Name Salir Backcolor (plomo-rojo)

Name Label3

Font (Algerian,20)

Forecolor (rojo) Caption (vacio)

Name + Backcolor (plomo- rojo)

Name Label4

Font A su gusto (Algerian,20)

Forecolor (rojo) Caption (vacio)

Name -

 TEXTBOX

Backcolor (plomo-rojo)

Cantidad 3

Font A su gusto (Algerian,20)

Name INGRESO Text (Vacío)

Name *

Name INGRESO2

Backcolor (plomo-rojo)

Text (Vacío)

Font A su gusto (Algerian,20)

Name RESULTADO

Diseñado por: Cristhian Tamami

Página 12


[LENGUAJE DE PROGRAMACIÓN I]

27 de mayo de 2014

Text (Vacío)

CODIFICACIÓN: Public Class Form2 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles suma.Click textr.Text = Val(text1.Text) + Val(text2.Text) End Sub Private Sub nuevo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles nuevo.Click text1.Text = " " text2.Text = " " textr.Text = " " End Sub Private Sub salir_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles salir.Click End End Sub Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click textr.Text = Val(text1.Text) - Val(text2.Text) End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click textr.Text = Val(text1.Text) * Val(text2.Text) End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click textr.Text = Val(text1.Text) / Val(text2.Text) End Sub Private Sub text1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles text1.KeyPress If Char.IsDigit(e.KeyChar) Then e.Handled = False ElseIf Char.IsControl(e.KeyChar) Then e.Handled = False Else e.Handled = True End If End Sub End Class

Diseñado por: Cristhian Tamami

Página 13


[LENGUAJE DE PROGRAMACIÓN I]

27 de mayo de 2014

CORRIDO:

Diseñado por: Cristhian Tamami

Página 14


[LENGUAJE DE PROGRAMACIÓN I]

27 de mayo de 2014

CARATULA

2.- SEGUNDO PROGRAMA: TEMA: VERIFICAR SI UN NUMERO ES PAR O IMPAR ENUNCIADO: 1. Abrir un nuevo Proyecto en Visual Basic 2. Apariencia del Formulario

ANALISIS: Componentes  FORM Name Form1

Name Button1 Backcolor (A su gusto) Caption Verificar

Caption Par Backcolor (A su gusto)

Name Button2

Windowstate Maximize

Backcolor (A su gusto)

 BUTTON

Caption Nuevo

Cantidad 3

Diseñado por: Cristhian Tamami

Página 15


[LENGUAJE DE PROGRAMACIÓN I]

27 de mayo de 2014

Name Button3

Caption Ingrese el Nombre

Backcolor (A su gusto)

Name Label3

Caption Salir

Forecolor (A su gusto)

 LABEL Cantidad 3

Caption El número es  TEXTBOX

Name Label1

Cantidad 2

Forecolor (A su gusto)

Name Ingreso

Caption Par o Impar

Text (Vacío)

Name Label2

Name Resultado

Forecolor (A su gusto)

Text (Vacío)

CODIFICACION: Public Class Form2 Private Sub txtingreso_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtingreso.KeyPress If Char.IsDigit(e.KeyChar) Then e.Handled = False ElseIf Char.IsControl(e.KeyChar) Then e.Handled = False Else e.Handled = True End If End Sub Private Sub txtresp_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtresp.KeyPress If Char.IsDigit(e.KeyChar) Then e.Handled = False ElseIf Char.IsControl(e.KeyChar) Then e.Handled = False Else e.Handled = True End If End Sub Private Sub cmdsalir_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdsalir.Click End End Sub

Diseñado por: Cristhian Tamami

Página 16


[LENGUAJE DE PROGRAMACIÓN I]

27 de mayo de 2014

Private Sub cmdnuevo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdnuevo.Click txtingreso.Text = " " txtresp.Text = " " End Sub Private Sub cmdverificar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdverificar.Click If (Val(txtingreso.Text Mod 2) = 0) Then txtresp.Text = "Par" Else txtresp.Text = "Impar" End If End Sub End Class

CORRIDO:

3.-TERCER PROGRAMA TEMA: TABLA DE MULTIPLICAR ENUNCIADO: 3.-Diseñe una aplicación que me genere la tabla de multiplicar 1. Abrir un nuevo Proyecto en Visual Basic 2. Apariencia del Formulario

Diseñado por: Cristhian Tamami

Página 17


[LENGUAJE DE PROGRAMACIÓN I]

27 de mayo de 2014

ANALISIS: Componentes  FORM Name Form1 Backcolor (A su gusto) Windowstate Maximize

Name Command2 Backcolor (A su gusto) Caption Salir  LABEL Cantidad 1 Name Label1

 BUTTON Cantidad 2 Name Command1

Forecolor (A su gusto) Caption Tabla de Multiplicar  LISTBOX

Backcolor (A su gusto)

Cantidad 1

Caption Generar

Name List1 List (Vacío)

CODIFICACION: Public Class Tablas Private Sub cmdmultiplicar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdmultiplicar.Click Dim resultado, factor, i As Integer factor = InputBox("Ingrese el numero") For i = 1 To 12 Step 1 resultado = factor * i ListBox1.Items.Add(factor & "*" & i & "=" & resultado) Next End Sub End Class

CORRIDO:

Diseñado por: Cristhian Tamami

Página 18


[LENGUAJE DE PROGRAMACIÓN I]

27 de mayo de 2014

4.- CUARTO PROGRAMA: TEMA: PLANILLA DE LUZ ELÉCTRICA ENUNCIADO: 4.- Diseñe un proyecto que permita calcular la planilla de Luz eléctrica según los siguientes condicionamientos.      

Valide el ingreso de los datos en las cajas de texto de tal manera que solo permita el ingreso de números Valide los datos de la Lectura anterior y la Lectura actual de tal manera que la lectura actual es siempre mayor que la lectura anterior Se ingresan solo las lecturas anterior y actual y se genera automáticamente el Total a Pagar Proponga su propio diseño La aplicación se genera n veces según lo decida el usuario Programe todos los botones que considere necesarios

CODIFICACION: Public Class Form1 Private Sub txtact_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtact.LostFocus Dim actual As Double Dim anterior As Double Dim total As Double anterior = Val(txtant.Text)

Diseñado por: Cristhian Tamami

Página 19


[LENGUAJE DE PROGRAMACIÓN I]

27 de mayo de 2014

actual = Val(txtact.Text) If Val(txtact.Text) > Val(txtant.Text) Then MsgBox("La lectura actual debe ser mayor a la lectura anterior") txtact.Focus() txtact.Text = " " End If txtcon.Text = anterior - actual txtvalores.Text = Val(txtcon.Text) * 0.68 txtalumbrado.Text = Val(txtcon.Text) * 0.03 txtbomberos.Text = Val(txtcon.Text) * 0.04 txtbasura.Text = Val(txtcon.Text) * 0.05 txtpagar.Text = Val(txtvalores.Text) + Val(txtalumbrado.Text) + Val(txtbomberos.Text) + Val(txtbasura.Text) End Sub End Class

CORRIDO:

Diseñado por: Cristhian Tamami

Página 20


[LENGUAJE DE PROGRAMACIÓN I]

27 de mayo de 2014

5.- QUINTO PROGRAMA TEMA: PROVINCIAS DEL ECUADOR ENUNCIADO: 5.- Diseñe una aplicación que mediante la selección de una provincia me genere la ciudad. 1. Abrir un nuevo Proyecto en Visual Basic 2. Apariencia del Formulario

ANALISIS: Componentes  FORM

Forecolor (A su gusto) Caption Provincias

Name Form1 Backcolor (A su gusto)

Name Label3

Windowstate Maximize

Forecolor (A su gusto)

 BUTTON Cantidad 1

Caption Capital  TEXTBOX Cantidad 1

Name Command1

Name Ingreso

Backcolor (A su gusto)

Caption (Vacío)

Caption Salir  LABEL

 COMBOBOX Cantidad 1

Cantidad 3 Name Provincias Name Label1

List Tungurahua

Forecolor (A su gusto)

Guayas

Caption Provincias del Ecuador

Pichincha El Oro

Name Label2

Diseñado por: Cristhian Tamami

Los Ríos

Página 21


[LENGUAJE DE PROGRAMACIÓN I]

27 de mayo de 2014

Azuay

CODIFICACION: Public Class Form2 Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged Select Case ComboBox1.SelectedIndex Case 0 txtcapitales.Text = "Cuenca" Case 1 txtcapitales.Text = "Guaranda" Case 2 txtcapitales.Text = "Azogues" Case 3 txtcapitales.Text = "Tulcan" Case 4 txtcapitales.Text = "Riobamba" Case 5 txtcapitales.Text = "Latacunga" End Select End Sub End Class

CORRIDO:

Diseñado por: Cristhian Tamami

Página 22


[LENGUAJE DE PROGRAMACIÓN I]

27 de mayo de 2014

6.- SEXTO PROGRAMA TEMA: CLAVE ENUNCIADO:

6.- Diseñe una aplicación que me permita realizar una clave para cualquier aplicación. 1. Abrir un nuevo Proyecto en Visual Basic 2. Apariencia del Formulario ANALISIS: Componentes  FORM Name Form1 Caption Clave Backcolor (A su gusto) Windowstate Maximize  BUTTON Cantidad 2 Name Command1 Backcolor (A su gusto) Caption Comprobar Name Command2 Backcolor (A su gusto) Caption Salir

Name Label2 Forecolor (A su gusto) Caption Ingrese la Clave Name Label3 Forecolor (A su gusto) Caption (Vacío) Name Label4 Forecolor (A su gusto) Caption (Vacío)  TEXTBOX Cantidad 1 Name Text1 Caption (Vacío)

 LABEL Cantidad 4

 TIMER Cantidad 1

Name Label1 Forecolor (A su gusto) Caption Clave

Name Timer1 Interval 300 Tag BIENVENIDOS AL SISTEMA

CODIFICACION: Public Class Form1 Private Sub TextBox1_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.LostFocus Dim mayuscula As String mayuscula = UCase$(TextBox1.Text) If mayuscula = "UTA" Then MsgBox("Contraseña Correcta Bienvenido ", MsgBoxStyle.OkOnly) Me.Hide() Form2.Show() Else

Diseñado por: Cristhian Tamami

Página 23


[LENGUAJE DE PROGRAMACIÓN I]

27 de mayo de 2014

MsgBox("Clave Incorrecta ", MsgBoxStyle.OkCancel) TextBox1.Focus() TextBox1.Text = "" End If End Sub Private Sub BIENVENIDO_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick Me.Text = Timer1.Tag Timer1.Tag = Mid(Timer1.Tag, 2) & Microsoft.VisualBasic.Left(Timer1.Tag, 1) End Sub End Class

CORRIDO:

7.- SEPTIMO PROGRAMA TEMA: PROFORMAS ENUNCIADO: 7.- Se necesita diseñar un proyecto de una proforma de partes y piezas de un equipo de computo, observe que no existe ningún botón calcular por lo tanto determine donde va la programación para que mientras se van seleccionando los artículos según las cantidades deseadas se va visualizando, el subtotal, 12% iva, total, que debe pagar el cliente.

Diseñado por: Cristhian Tamami

Página 24


[LENGUAJE DE PROGRAMACIÓN I]

27 de mayo de 2014

ANALISIS:  Los cuadros de lista al desplegarse ya contienen datos, utilice la propiedad que le corresponde.  Utilice la sentencia de ingreso de datos en la caja de texto de cantidad  Utilice el formato para cantidades  Valide todos datos que sean procedentes  Incluya un formulario de clave

CODIFICACION: Public Class Form1 Dim subtotal As Double = 0 Dim total As Double = 0 Dim a As Double = 0.15 Dim b As Double = 0.08 Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged Select Case ComboBox1.SelectedIndex Case Is = 0 txtunitario.Text = 293.57 Case Is = 1 txtunitario.Text = 214.13 Case Is = 2 txtunitario.Text = 102.68 End Select End Sub Private Sub ComboBox2_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox2.SelectedIndexChanged Select Case ComboBox2.SelectedIndex Case Is = 0 txtunitariom.Text = 90.56 Case Is = 1 txtunitariom.Text = 85.33 Case Is = 2 txtunitariom.Text = 50.45 End Select End Sub Private Sub ComboBox3_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox3.SelectedIndexChanged Select Case ComboBox3.SelectedIndex Case Is = 0 txtunitarioi.Text = 356.9 Case Is = 1 txtunitarioi.Text = 110.5 Case Is = 2 txtunitarioi.Text = 286.75 End Select End Sub Private Sub ComboBox4_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox4.SelectedIndexChanged

Diseñado por: Cristhian Tamami

Página 25


[LENGUAJE DE PROGRAMACIÓN I]

27 de mayo de 2014

Select Case ComboBox4.SelectedIndex Case Is = 0 txtunitariomi.Text = 397.52 Case Is = 1 txtunitariomi.Text = 177.68 Case Is = 2 txtunitariomi.Text = 266.78 End Select End Sub Private Sub ComboBox5_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox5.SelectedIndexChanged Select Case ComboBox5.SelectedIndex Case Is = 0 txtunitarioc.Text = 120.54 Case Is = 1 txtunitarioc.Text = 98.21 Case Is = 2 txtunitarioc.Text = 89.1 End Select End Sub Private Sub txtcantidad_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtcantidad.LostFocus txtcand.Text = txtunitario.Text * txtcantidad.Text subtotal = subtotal + txtcand.Text txtsub.Text = subtotal txtiva.Text = txtsub.Text * 0.12 txttotal.Text = txtiva.Text + subtotal End Sub Private Sub txtcantidadm_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtcantidadm.LostFocus txtcanm.Text = txtunitariom.Text * txtcantidadm.Text subtotal = subtotal + txtcanm.Text txtsub.Text = subtotal txtiva.Text = txtsub.Text * 0.12 txttotal.Text = txtiva.Text + subtotal End Sub Private Sub txtcantidadi_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtcantidadi.LostFocus txtcani.Text = txtunitarioi.Text * txtcantidadi.Text subtotal = subtotal + txtcani.Text txtsub.Text = subtotal txtiva.Text = txtsub.Text * 0.12 txttotal.Text = txtiva.Text + subtotal End Sub Private Sub txtcantidadmi_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtcantidadmi.LostFocus txtcanmi.Text = txtunitariomi.Text * txtcantidadmi.Text subtotal = subtotal + txtcanmi.Text txtsub.Text = subtotal txtiva.Text = txtsub.Text * 0.12 txttotal.Text = txtiva.Text + subtotal

Diseñado por: Cristhian Tamami

Página 26


[LENGUAJE DE PROGRAMACIÓN I]

27 de mayo de 2014

End Sub Private Sub txtcantidadc_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtcantidadc.LostFocus txtcanc.Text = txtunitarioc.Text * txtcantidadc.Text subtotal = subtotal + txtcanc.Text txtsub.Text = subtotal txtiva.Text = txtsub.Text * 0.12 txttotal.Text = txtiva.Text + subtotal End Sub Private Sub CheckBox1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles CheckBox1.Click txtdes.Text = a * txttotal.Text txtpagar.Text = txttotal.Text - txtdes.Text End Sub Private Sub CheckBox2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles CheckBox2.Click txtdes8.Text = b * txttotal.Text txtpagar.Text = txttotal.Text - txtdes8.Text End Sub End Class

CORRIDO:

8.- OCTAVO PROGRAMA: TEMA: CALCULADORA ENUNCIADO:

8.-Realizar una aplicación que sea un simulador de una calculadora con todas sus operaciones básicas.

Diseñado por: Cristhian Tamami

Página 27


[LENGUAJE DE PROGRAMACIÓN I]

27 de mayo de 2014

ANALISIS: Componentes  FORM Name Form1 Backcolor (A su gusto) Windowstate Maximize

Name 8 Backcolor (A su gusto) Caption (vacio)

 BUTTON Cantidad 17

Name 9 Backcolor (A su gusto) Caption (vacio)

Name 1 Backcolor (A su gusto) Caption (vacio)

Name 0 Backcolor (A su gusto) Caption (vacio)

Name 2 Backcolor (A su gusto) Caption (vacio)

Name suma Backcolor (A su gusto) Caption (vacio)

Name 3 Backcolor (A su gusto) Caption (vacio)

Name resta Backcolor (A su gusto) Caption (vacio)

Name 4 Backcolor (A su gusto) Caption (vacio)

Name multiplicacion Backcolor (A su gusto) Caption (vacio)

Name 5 Backcolor (A su gusto) Caption (vacio)

Name division Backcolor (A su gusto) Caption (vacio)

Name 6 Backcolor (A su gusto) Caption (vacio)

 LABEL Cantidad 1

Name 7 Backcolor (A su gusto) Caption (vacio)

Name Label1 Forecolor (A su gusto) Caption operaciones

CODIFICACION: Public Class Form1 Dim dato1, dato2, resultado, operacion, punto As Double Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button10.Click TextBox1.Text = TextBox1.Text & "0"

Diseñado por: Cristhian Tamami

Página 28


[LENGUAJE DE PROGRAMACIÓN I]

27 de mayo de 2014

End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click TextBox1.Text = TextBox1.Text & "1" End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click TextBox1.Text = TextBox1.Text & "2" End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click TextBox1.Text = TextBox1.Text & "3" End Sub Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click TextBox1.Text = TextBox1.Text & "4" End Sub Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click TextBox1.Text = TextBox1.Text & "5" End Sub Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click TextBox1.Text = TextBox1.Text & "6" End Sub Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click TextBox1.Text = TextBox1.Text & "7" End Sub Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click TextBox1.Text = TextBox1.Text & "8" End Sub Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click TextBox1.Text = TextBox1.Text & "9" End Sub Private Sub Button17_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button17.Click TextBox1.Clear() mcdpunto.Enabled = True End Sub Private Sub Button12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button12.Click

Diseñado por: Cristhian Tamami

Página 29


[LENGUAJE DE PROGRAMACIÓN I]

27 de mayo de 2014

operacion = 1 dato1 = Val(TextBox1.Text) TextBox1.Clear() mcdpunto.Enabled = True End Sub Private Sub Button13_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button13.Click operacion = 2 dato1 = Val(TextBox1.Text) TextBox1.Clear() mcdpunto.Enabled = True End Sub Private Sub Button14_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button14.Click operacion = 3 dato1 = Val(TextBox1.Text) TextBox1.Clear() mcdpunto.Enabled = True End Sub Private Sub Button15_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button15.Click operacion = 4 dato1 = Val(TextBox1.Text) TextBox1.Clear() mcdpunto.Enabled = True End Sub Private Sub Button16_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button16.Click dato2 = Val(TextBox1.Text) If operacion = 1 Then resultado = dato1 + dato2 TextBox1.Text = resultado Else If operacion = 2 Then resultado = dato1 - dato2 TextBox1.Text = resultado Else If operacion = 3 Then resultado = dato1 * dato2 TextBox1.Text = resultado Else If operacion = 4 Then resultado = dato1 / dato2 TextBox1.Text = resultado End If End If End If End If mcdpunto.Enabled = True End Sub

Diseñado por: Cristhian Tamami

Página 30


[LENGUAJE DE PROGRAMACIÓN I]

27 de mayo de 2014

Private Sub mcdpunto_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mcdpunto.Click TextBox1.Text = TextBox1.Text & "." punto = 1 If punto = 1 Then mcdpunto.Enabled = False End If End Sub End Class

CORRIDO:

9.- NOVENO PROGRAMA TEMA: ROL DE PAGOS ENUNCIADO: 9.- Diseñe un proyecto que me permita automatizar la nomina de personal(rol de pagos) de una empresa.

ANALISIS: 

 

La empresa tiene 3 tipos de empleados que son - Administrativos con un salario básico Usd 750,00 - Ejecutivos con un salario básico de Usd 1200,00 - De servicio con un salario de Usd 400,00 Se ingresan los datos personales del empleado a lado izquierdo de la pantalla y los datos del rol a lado derecho. Se validan los datos según el ingreso solo letras solo numeros

Diseñado por: Cristhian Tamami

Página 31


[LENGUAJE DE PROGRAMACIÓN I]      

27 de mayo de 2014

Se realizan todos los cálculos pertinentes Obtenga el valor del IESS que es el 11,5% del nominal Se ingresan horas Extras en donde que ningún empleado puede excede de las 10 horas extras , cada hora extra representa el 6% del salario básico Subsidio familiar la misma que esta condicionada Si el empleado tiene más de dos hijos se le paga Usd. 6,50 por cada hijo caso contrario se le reconoce Usd. 8,5 por cada hijo Se ingresan los datos correspondientes al numero de multas si el empleado excede de las 8 faltas se le descuenta el 20% del salario básico. Caso contrario se le descuenta 3Usd por c/h faltada Se ingresan los datos correspondientes a prestamos si lo tiene o no

CODIFICACION: Public Class Form1 Dim a As Double = 0.06 Dim he As Double Private Sub ComboBox1_SelectedIndexChanged_1(sender As System.Object, e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged Select Case ComboBox1.SelectedIndex Case Is = 0 txtbasico.Text = 750.0 Case Is = 1 txtbasico.Text = 1200.0 Case Is = 2 txtbasico.Text = 400.0 End Select txtiess.Text = txtbasico.Text * 0.115 End Sub Private Sub txthoras_TextChanged(sender As System.Object, e As System.EventArgs) Handles txthoras.TextChanged If txthoras.Text > 10 Then MsgBox(" NO EXECER LAS 10 HORAS") End If he = txtbasico.Text * a txthorasextras.Text = txthoras.Text * he End Sub Private Sub txtsubfami_LostFocus(sender As Object, e As System.EventArgs) Handles txtsubfami.LostFocus 'Dim a As Double txtingresos.Text = (Val(txtbasico.Text) + Val(txthorasextras.Text) + Val(txttotalsub.Text) + Val(txtiess.Text)) End Sub Private Sub txtsubfami_TextChanged(sender As System.Object, e As System.EventArgs) Handles txtsubfami.TextChanged If txtsubfami.Text > 2 Then txttotalsub.Text = txtsubfami.Text * 6.5 End If If txtsubfami.Text <= 2 Then

Diseñado por: Cristhian Tamami

Página 32


[LENGUAJE DE PROGRAMACIÓN I]

27 de mayo de 2014

txttotalsub.Text = txtsubfami.Text * 8.5 End If End Sub Private Sub txtmultas_LostFocus(sender As Object, e As System.EventArgs) Handles txtmultas.LostFocus txtegresos.Text = Val(txtvalormultas.Text) + Val(tstpres.Text) txtrecibir.Text = Val(txtingresos.Text) - Val(txtegresos.Text) End Sub Private Sub txtmultas_TextChanged(sender As System.Object, e As System.EventArgs) Handles txtmultas.TextChanged If txtmultas.Text > 8 Then txtvalormultas.Text = txtbasico.Text * 0.2 Else txtvalormultas.Text = txtmultas.Text * 3 End If End Sub End Class

CORRIDO:

Diseñado por: Cristhian Tamami

Página 33


[LENGUAJE DE PROGRAMACIÓN I]

27 de mayo de 2014

10.- DECIMO PROGRAMA TEMA: SISTEMA SOLAR ENUNCIADO: 10.- Diseñar el entorno del formulario para la aplicación 1. Abrir un nuevo documento de Visual 2. Asignar un nombre al Proyecto

CODIFICACION: Public Class Form1 Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged Select Case ComboBox1.SelectedIndex Case Is = 0 PictureBox1.Image = ImageList1.Images(1) txtdescri.Text = "Mercurio recibió este nombre de los romanos por el mensajero de pies alados de los dioses ya que parecía moverse más rápido que ningún otro planeta. Es el planeta más cercano al Sol, y el segundo más pequeño del sistema solar. Su diámetro es un 40% más pequeño que la Tierra y un 40% más grande que la Luna. Es incluso más pequeño que la luna de Júpiter, Ganimedes o la luna de Saturno, Titán. " Case Is = 1 PictureBox1.Image = ImageList1.Images(2) txtdescri.Text = "Venus, la joya del cielo, fue conocida antaño por los astrónomos por el nombre de estrella de la mañana y estrella de la tarde. Los primeros astrónomos pensaron que Venus podría ser en realidad dos cuerpos separados. Venus, que recibe el nombre de la diosa romana del amor y la belleza, está oculto por una gruesa cubierta turbulenta de nubes. " Case Is = 2 PictureBox1.Image = ImageList1.Images(3) txtdescri.Text = "Desde la perspectiva que tenemos en la Tierra, nuestro planeta parece ser grande y fuerte con un océano de aire interminable. Desde el espacio, los astronautas frecuentemente tienen la impresión de que la Tierra es pequeña, con una delgada y frágil capa de atmósfera. Para un viajero espacial, las características distintivas de la Tierra son las aguas azules, masas de tierra café y verde y nubes blancas contrastando con un fondo negro. " Case Is = 3 PictureBox1.Image = ImageList1.Images(4) txtdescri.Text = "Marte es el cuarto planeta desde el Sol y suele recibir el nombre de Planeta Rojo. Las rocas, suelo y cielo tienen una tonalidad rojiza o rosacea. Este característico color rojo fue observado por los astrónomos a lo largo de la historia. Los romanos le dieron nombre en honor de su dios de la guerra. Otras civilizaciones tienen nombres similares. Los antiguos Egípcios lo llamaron Her Descher que significa el rojo. " Case Is = 4 PictureBox1.Image = ImageList1.Images(5) txtdescri.Text = "Júpiter es el quinto plantea desde el Sol y es el mayor del Sistema Solar. Si Júpiter estuviera vacio, cabrían en su interior más de

Diseñado por: Cristhian Tamami

Página 34


[LENGUAJE DE PROGRAMACIÓN I]

27 de mayo de 2014

mil Tierras. También contiene más materia que el resto de los planetas combinados. Tiene una masa de 1.9 x 1027 kg y un diámetro ecuatorial de 142,800 kilómetros (88,736 millas). Júpiter posee 16 satélites, cuatro de ellos - Calisto, Europa, Ganimedes e Io - fueron observados ya por Galileo en 1610. Existe un sistema de anillos, pero muy tenue y es invisible desde la Tierra " Case Is = 5 PictureBox1.Image = ImageList1.Images(6) txtdescri.Text = "Saturno es el sexto planeta desde el Sol y el segundo más grande del Sistema Solar con un diámetro ecuatorial de 119,300 kilómetros (74,130 millas). Gran parte de lo que sabemos sobre este planeta es debido a las exploraciones Voyager en 1980-81. Saturno está claramente achatado en los polos, como resultado de la rápida rotación del planeta alrededor de su eje. Su día dura 10 horas, 39 minutos y tarda 29.5 años terrestres en completar su órbita alrededor del Sol. " Case Is = 6 PictureBox1.Image = ImageList1.Images(7) txtdescri.Text = "Urano es el séptimo planeta desde el Sol y es el tercero más grande del Sistema Solar. Fue descubierto por William Herschel en 1781. Tiene un diámetro ecuatorial de 51,800 kilómetros (32,190 millas) y completa su órbita alrededor del Sol cada 84.01 años terrestres. Está a una distancia media del Sol de 2,870 millones de kilómetros (1,780 millones de millas). El día de Urano dura 17 horas y 14 minutos. Urano tiene al menos 15 lunas. Las dos más grandes, Titania y Oberón, fueron descubiertas por William Herschel en 1787 " Case Is = 7 PictureBox1.Image = ImageList1.Images(8) txtdescri.Text = "Neptuno es el planeta más exterior de los gigantes gaseosos. Tiene un diámetro ecuatorial de 49,500 kilómetros (30,760 millas). Si Neptuno estuviera vacio, contendría casi 60 Tierras. Neptuno completa su órbita alrededor del Sol cada 165 años. Tiene ocho lunas, seis de las cuales fueron descubiertas por la nave Voyager. Un día de Neptuno tiene 16 horas y 6.7 minutos. Neptuno fue descubierto el 23 de Septiembre de 1846 por Johann Gottfried Galle, del Observatorio de Berlín, y Louis Diseñado por: Ing. M.Sc. Wilma Gavilanes - 53 -d() 'Arrest, un estudiante de astronomía, a través de predicciones matemáticas realizadas por Urbain Jean Joseph Le Verrier. " End Select End Sub End Class

CORRIDO:

Diseñado por: Cristhian Tamami

Página 35


[LENGUAJE DE PROGRAMACIÓN I]

27 de mayo de 2014

MENU

Diseñado por: Cristhian Tamami

Página 36


[LENGUAJE DE PROGRAMACIÓN I]

27 de mayo de 2014

11.- ONCEAVO PROGRAMA TEMA: JUEGO DEL AHORCADO ENUNCIADO: 11. Diseñe una aplicación que me permita realizar el juego del ahorcado utilizando todas las herramientas de visual studio 2010.

CODIFICACION: Public Class Form1 Dim c As Integer = 1 Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load lbljt.Visible = False LineShape1.Visible = False LineShape2.Visible = False LineShape3.Visible = False LineShape4.Visible = False LineShape5.Visible = False OvalShape1.Visible = False OvalShape2.Visible = False OvalShape3.Visible = False LineShape6.Visible = False LineShape7.Visible = False LineShape8.Visible = False LineShape9.Visible = False LineShape10.Visible = False LineShape11.Visible = False lblg.Visible = False End Sub Private Sub TextBox1_TextChanged(sender As System.Object, e As System.EventArgs) Handles TextBox1.TextChanged If Not (TextBox1.Text) = " " Then If Asc(TextBox1.Text) = 67 Then MsgBox("Correcto") TextBox1.Enabled = False Else If c = 1 Then MsgBox("Fallaste") TextBox1.Text = " " LineShape1.Visible = True LineShape1.Visible = True LineShape2.Visible = True LineShape3.Visible = True LineShape4.Visible = True LineShape5.Visible = True LineShape6.Visible = True OvalShape1.Visible = True OvalShape2.Visible = True OvalShape3.Visible = True

Diseñado por: Cristhian Tamami

Página 37


[LENGUAJE DE PROGRAMACIÓN I]

27 de mayo de 2014

TextBox1.Focus() Else If c = 2 Then MsgBox("Fallaste") LineShape7.Visible = True LineShape8.Visible = True LineShape9.Visible = True TextBox1.Text = " " TextBox1.Focus() Else If c = 3 Then MsgBox("Fallaste") LineShape10.Visible = True LineShape11.Visible = True TextBox1.Enabled = False TextBox2.Enabled = False TextBox3.Enabled = False TextBox4.Enabled = False TextBox5.Enabled = False TextBox6.Enabled = False TextBox1.Focus() lbljt.Visible = True End If End If End If c = c + 1 End If End If End Sub Private Sub TextBox2_TextChanged(sender As System.Object, e As System.EventArgs) Handles TextBox2.TextChanged If Not (TextBox2.Text) = " " Then If Asc(TextBox2.Text) = 79 Then MsgBox("Correcto") TextBox2.Enabled = False Else If c = 1 Then MsgBox("Fallaste") TextBox2.Text = " " LineShape1.Visible = True LineShape1.Visible = True LineShape2.Visible = True LineShape3.Visible = True LineShape4.Visible = True LineShape5.Visible = True LineShape6.Visible = True OvalShape1.Visible = True OvalShape2.Visible = True OvalShape3.Visible = True TextBox2.Focus() Else

Diseñado por: Cristhian Tamami

Página 38


[LENGUAJE DE PROGRAMACIÓN I]

27 de mayo de 2014

If c = 2 Then MsgBox("Fallaste") LineShape7.Visible = True LineShape8.Visible = True LineShape9.Visible = True TextBox2.Text = " " TextBox2.Focus() Else If c = 3 Then MsgBox("Fallaste") LineShape10.Visible = True LineShape11.Visible = True TextBox2.Enabled = False TextBox3.Enabled = False TextBox4.Enabled = False TextBox5.Enabled = False TextBox6.Enabled = False TextBox1.Enabled = False TextBox2.Focus() lbljt.Visible = True End If End If End If c = c + 1 End If End If End Sub Private Sub TextBox3_TextChanged(sender As System.Object, e As System.EventArgs) Handles TextBox3.TextChanged If Not (TextBox3.Text) = " " Then If Asc(TextBox3.Text) = 78 Then MsgBox("Correcto") TextBox3.Enabled = False Else If c = 1 Then MsgBox("Fallaste") TextBox3.Text = " " LineShape1.Visible = True LineShape1.Visible = True LineShape2.Visible = True LineShape3.Visible = True LineShape4.Visible = True LineShape5.Visible = True LineShape6.Visible = True OvalShape1.Visible = True OvalShape2.Visible = True OvalShape3.Visible = True TextBox3.Focus() Else If c = 2 Then MsgBox("Fallaste")

Diseñado por: Cristhian Tamami

Página 39


[LENGUAJE DE PROGRAMACIÓN I]

27 de mayo de 2014

LineShape7.Visible = True LineShape8.Visible = True LineShape9.Visible = True TextBox3.Text = " " TextBox3.Focus() Else If c = 3 Then MsgBox("Fallaste") LineShape10.Visible = True LineShape11.Visible = True TextBox3.Enabled = False TextBox4.Enabled = False TextBox5.Enabled = False TextBox6.Enabled = False TextBox1.Enabled = False TextBox2.Enabled = False TextBox3.Focus() lbljt.Visible = True End If End If End If c = c + 1 End If End If End Sub Private Sub TextBox4_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox4.TextChanged If Not (TextBox4.Text) = " " Then If Asc(TextBox4.Text) = 69 Then MsgBox("Correcto") TextBox4.Enabled = False Else If c = 1 Then MsgBox("Fallaste") TextBox5.Text = " " LineShape1.Visible = True LineShape1.Visible = True LineShape2.Visible = True LineShape3.Visible = True LineShape4.Visible = True LineShape5.Visible = True LineShape6.Visible = True OvalShape1.Visible = True OvalShape2.Visible = True OvalShape3.Visible = True TextBox4.Focus() Else If c = 2 Then MsgBox("Fallaste") LineShape7.Visible = True LineShape8.Visible = True

Diseñado por: Cristhian Tamami

Página 40


[LENGUAJE DE PROGRAMACIÓN I]

27 de mayo de 2014

LineShape9.Visible = True TextBox4.Text = " " TextBox4.Focus() Else If c = 3 Then MsgBox("Fallaste") LineShape10.Visible = True LineShape11.Visible = True TextBox4.Enabled = False TextBox5.Enabled = False TextBox6.Enabled = False TextBox1.Enabled = False TextBox2.Enabled = False TextBox3.Enabled = False TextBox4.Focus() lbljt.Visible = True End If End If End If c = c + 1 End If End If End Sub Private Sub TextBox5_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox5.TextChanged If Not (TextBox5.Text) = " " Then If Asc(TextBox5.Text) = 74 Then MsgBox("Correcto") TextBox5.Enabled = False Else If c = 1 Then MsgBox("Fallaste") TextBox5.Text = " " LineShape1.Visible = True LineShape1.Visible = True LineShape2.Visible = True LineShape3.Visible = True LineShape4.Visible = True LineShape5.Visible = True LineShape6.Visible = True OvalShape1.Visible = True OvalShape2.Visible = True OvalShape3.Visible = True TextBox5.Focus() Else If c = 2 Then MsgBox("Fallaste") LineShape7.Visible = True LineShape8.Visible = True LineShape9.Visible = True TextBox5.Text = " "

Diseñado por: Cristhian Tamami

Página 41


[LENGUAJE DE PROGRAMACIÓN I]

27 de mayo de 2014

TextBox5.Focus() Else If c = 3 Then MsgBox("Fallaste") LineShape10.Visible = True LineShape11.Visible = True TextBox5.Enabled = False TextBox6.Enabled = False TextBox1.Enabled = False TextBox2.Enabled = False TextBox3.Enabled = False TextBox4.Enabled = False TextBox5.Focus() lbljt.Visible = True End If End If End If c = c + 1 End If End If End Sub Private Sub TextBox6_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox6.TextChanged If Not (TextBox6.Text) = " " Then If Asc(TextBox6.Text) = 79 Then MsgBox("Correcto") TextBox6.Enabled = False Else If c = 1 Then MsgBox("Fallaste") TextBox6.Text = " " LineShape1.Visible = True LineShape1.Visible = True LineShape2.Visible = True LineShape3.Visible = True LineShape4.Visible = True LineShape5.Visible = True LineShape6.Visible = True OvalShape1.Visible = True OvalShape2.Visible = True OvalShape3.Visible = True TextBox6.Focus() Else If c = 2 Then MsgBox("Fallaste") LineShape7.Visible = True LineShape8.Visible = True LineShape9.Visible = True TextBox6.Text = " " TextBox6.Focus()

Diseñado por: Cristhian Tamami

Página 42


[LENGUAJE DE PROGRAMACIÓN I]

27 de mayo de 2014

Else If c = 3 Then MsgBox("Fallaste") LineShape10.Visible = True LineShape11.Visible = True TextBox6.Enabled = False TextBox1.Enabled = False TextBox2.Enabled = False TextBox3.Enabled = False TextBox4.Enabled = False TextBox5.Enabled = False TextBox6.Focus() lbljt.Visible = True End If End If End If c = c + 1 End If lblg.Visible = True End If End Sub Private Sub cmdsalir_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdsalir.Click Me.Hide() Form3.Show() End Sub End Class

CORRIDO:

Diseñado por: Cristhian Tamami

Página 43


[LENGUAJE DE PROGRAMACIÓN I]

27 de mayo de 2014

12.- DOCEAVO PROGRAMA TEMA: JUEGO CASINO ENUNCIADO: 12.- Generación de numeros Randómicos

ANALISIS: Componentes

Windowstate Maximize

 FORM Name Form1

 BUTTON

Caption Casino

Cantidad 2

Backcolor (A su gusto)

Name Command1

Diseñado por: Cristhian Tamami

Página 44


[LENGUAJE DE PROGRAMACIÓN I]

27 de mayo de 2014

Backcolor (A su gusto) Caption Jugar

Name Label3 Forecolor (A su gusto)

Name Command2

Caption (Vacío)

Backcolor (A su gusto) Caption Salir

Name Label4 Forecolor (A su gusto)

 LABEL

Caption (Vacío)

Cantidad 4 Name Label1 Forecolor (A su gusto)

 IMAGE

Caption Casino

Cantidad 2

Name Label2

Image1 Visible false

Forecolor (A su gusto)

Image2 Visible false

Caption (Vacío)

CODIFICACION: Public Class Form2 Private Sub cmdjugar_Click(sender As System.Object, e As System.EventArgs) Handles cmdjugar.Click Dim N1, N2, N3 As Byte Randomize() PictureBox1.Visible = False PictureBox2.Visible = False Do N1 = Int(Rnd() * 10) Loop While (N1 < 1) Or (N1 > 6) Do N2 = Int(Rnd() * 10) Loop While (N2 < 1) Or (N2 > 6) Do N3 = Int(Rnd() * 10) Loop While (N3 < 1) Or (N3 > 6) Label1.Text = N1 Label2.Text = N2 Label3.Text = N3 If (Label1.Text = Label2.Text) And (Label1.Text = Label2.Text) Then MsgBox("!GANASTE!")

Diseñado por: Cristhian Tamami

Página 45


[LENGUAJE DE PROGRAMACIÓN I]

27 de mayo de 2014

PictureBox1.Visible = True PictureBox2.Visible = False Else MsgBox("!PERDISTE!") PictureBox1.Visible = False PictureBox2.Visible = True End If End Sub Private Sub Form2_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load PictureBox1.Visible = False PictureBox2.Visible = False End Sub Private Sub cmdsalir_Click(sender As System.Object, e As System.EventArgs) Handles cmdsalir.Click Me.Hide() Form3.Show() End Sub End Class

CORRIDO:

13.- TRECEAVO PROGRAMA SIMULADOR DE SEMAFORO ENUNCIADO: 13.- Diseñe un simulador en la aplicación visual studio utilizando todos los componentes necesarios.

ANALISIS:  Colocar: 1 label, 2 button y 1 timer (Conjunto "Componentes").  Colocar la propiedad Text de los botones según se requiera.

Diseñado por: Cristhian Tamami

Página 46


[LENGUAJE DE PROGRAMACIÓN I]

27 de mayo de 2014

 Ahora que ya tenemos diseñado nuestro formulario hacemos doble clic sobre cualquiera de los botones para entrar a la parte del código y nos declaramos e inicializamos las siguientes variables.  Ahora nos creamos una función que dibujara un semáforo vacío.  Ahora realizamos el código que estará en el evento tick del timer (Se ejecutará cada que se cumpla el intervalo en el que este configurado el timer). (Para invocar a este método solo es necesario hacerle doble clic al timer que esta sobre la banda celeste claro (color variable de acuerdo a la configuración de cada persona), o también se puede hacer doble clic sobre el evento tick, en el listado de eventos (El timer solo tiene este evento).  Ahora colocamos los códigos respectivos para los botones: button1 dibujara un semáforo vacío, y el button2 encenderá el timer.

CODIFICACION: Public Class Form1 Private Sub semaforo() Dim i As Integer For i = 5 To 100 Timer1.Start() Next End Sub Private Sub recta_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load lblamarillo.Visible = False lblverde.Visible = False lblrojo.Visible = False projo1.Visible = False projo2.Visible = False pverde1.Visible = False pverde2.Visible = False semaforo() End Sub Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick lblrojo.Visible = True lblverde.Visible = False projo1.Visible = False projo2.Visible = False pverde1.Visible = True pverde2.Visible = True Timer1.Stop() Timer2.Start()

Diseñado por: Cristhian Tamami

Página 47


[LENGUAJE DE PROGRAMACIÓN I]

27 de mayo de 2014

End Sub Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick lblamarillo.Visible = True lblrojo.Visible = False Timer2.Stop() Timer3.Start() End Sub Private Sub Timer3_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer3.Tick lblverde.Visible = True lblamarillo.Visible = False projo1.Visible = True projo2.Visible = True pverde1.Visible = False pverde2.Visible = False Timer3.Stop() Timer1.Start() End Sub End Class

CORRIDO:

Diseñado por: Cristhian Tamami

Página 48


[LENGUAJE DE PROGRAMACIÓN I]

27 de mayo de 2014

14.- CATORCEAVO PROGRAMA TEMA: SIMULADOR ALARMA ENUNCIADO: 14.- Diseñar un simulador de alarma en la aplicación visual studio 2010.

CODIFICACION: Public Class Form1 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load, btncarga.Click Timer1.Start() End Sub Private Sub btnWakeup_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnWakeup.Click Timer2.Stop() End Sub Private Sub btncarga_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Timer2.Start() End Sub

Diseñado por: Cristhian Tamami

Página 49


[LENGUAJE DE PROGRAMACIÓN I]

27 de mayo de 2014

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick TextBox1.Text = TimeString End Sub Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick If TextBox2.Text = TextBox1.Text Then MsgBox(" / / / A L A R M A / / / ") End If End Sub Private Sub cmdsalir_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdsalir.Click End End Sub Private Sub cmdnuevo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdnuevo.Click TextBox2.Text = "" End Sub End Class

CORRIDO:

Diseñado por: Cristhian Tamami

Página 50


[LENGUAJE DE PROGRAMACIÓN I]

27 de mayo de 2014

15.- QUINCEAVO PROGRAMA 15. 1.- DATOS PERSDONALES ENUNCIADO: 15.1.- Diseñar una aplicación utilizando todas las herramientas e visual studio 2010 sobre los daos de cada persona.

ANALISIS: Componentes

Caption Datos personales

 FORM Name Form1

Name Label3

Caption Colores de Letra

Forecolor color-negro

Backcolor (A su gusto)

Caption Datos personales

Windowstate Maximize  LABEL

 BUTTON Cantidad 2

Cantidad 3

Name cmdnuevo

Name Label1

Backcolor plomo-negro color

Forecolor color-negro

Caption Nuevo

Caption Datos personales Name cmdsalir Name Label2

Backcolor plomo-negro color

Forecolor color-negro

Caption Salir

Diseñado por: Cristhian Tamami

Página 51


[LENGUAJE DE PROGRAMACIÓN I]

27 de mayo de 2014

Name Text4  TEXTBOX

Caption (Vacío)

Cantidad 4 Name Text1 Caption (Vacío)

 COMBOBOX Cantidad 2 Name ComboBox1

Name Text2

Backcolor negro.blanco

Caption (Vacío)

Caption (vacio)

Name Text3

Name ComboBox2

Caption (Vacío)

Backcolor negro.blanco Caption (vacio)

CODIFICACION: Public Class Form1 Private Sub ComboBox1_SelectedIndexChanged(sender As System.Object, e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged Select Case ComboBox1.SelectedIndex Case 0 txtestadocivil.Text = ComboBox1.Items.Item(0) Case 1 txtestadocivil.Text = ComboBox1.Items.Item(1) Case 2 txtestadocivil.Text = ComboBox1.Items.Item(2) Case 3 txtestadocivil.Text = ComboBox1.Items.Item(3) End Select End Sub Private Sub DateTimePicker1_ValueChanged(sender As System.Object, e As System.EventArgs) Handles DateTimePicker1.ValueChanged txtfecha.Text = DateTimePicker1.Value End Sub Private Sub TextBox1_KeyPress(sender As Object, e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress If Char.IsLetter(e.KeyChar) Then e.Handled = False ElseIf Char.IsControl(e.KeyChar) Then e.Handled = False Else MsgBox("SOLO LETRAS") e.Handled = True

Diseñado por: Cristhian Tamami

Página 52


[LENGUAJE DE PROGRAMACIÓN I]

27 de mayo de 2014

End If End Sub Private Sub TextBox2_KeyPress(sender As Object, e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox2.KeyPress If Char.IsLetter(e.KeyChar) Then e.Handled = False ElseIf Char.IsControl(e.KeyChar) Then e.Handled = False Else MsgBox("SOLO LETRAS") e.Handled = True End If End Sub

Private Sub NumericUpDown1_ValueChanged(sender As System.Object, e As System.EventArgs) Handles NumericUpDown1.ValueChanged TextBox5.Text = NumericUpDown1.Value End Sub Private Sub ComboBox2_SelectedIndexChanged(sender As System.Object, e As System.EventArgs) Handles ComboBox2.SelectedIndexChanged Select Case ComboBox2.SelectedIndex Case 0 txtocupacion.Text = ComboBox2.Items.Item(0) txtingreso.Text = "340,00" Case 1 txtocupacion.Text = ComboBox2.Items.Item(1) txtingreso.Text = "500,00" Case 2 txtocupacion.Text = ComboBox2.Items.Item(2) txtingreso.Text = "200,00" Case 3 txtocupacion.Text = ComboBox2.Items.Item(3) txtingreso.Text = "100,00" End Select End Sub Private Sub CheckBox1_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles CheckBox1.CheckedChanged If CheckBox1.Checked = True Then CheckBox2.Checked = False End If End Sub Private Sub CheckBox2_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles CheckBox2.CheckedChanged If CheckBox2.Checked = True Then CheckBox1.Checked = False End If End Sub

Diseñado por: Cristhian Tamami

Página 53


[LENGUAJE DE PROGRAMACIÓN I]

27 de mayo de 2014

Private Sub ComboBox3_SelectedIndexChanged(sender As System.Object, e As System.EventArgs) Handles ComboBox3.SelectedIndexChanged Select Case ComboBox3.SelectedIndex Case 0 txtprimaria.Text = ComboBox3.Items.Item(0) Case 1 txtprimaria.Text = ComboBox3.Items.Item(1) Case 2 txtprimaria.Text = ComboBox3.Items.Item(2) Case 3 txtprimaria.Text = ComboBox3.Items.Item(3) End Select End Sub Private Sub ComboBox4_SelectedIndexChanged(sender As System.Object, e As System.EventArgs) Handles ComboBox4.SelectedIndexChanged Select Case ComboBox4.SelectedIndex Case 0 txtsecundaria.Text = ComboBox4.Items.Item(0) Case 1 txtsecundaria.Text = ComboBox4.Items.Item(1) Case 2 txtsecundaria.Text = ComboBox4.Items.Item(2) Case 3 txtsecundaria.Text = ComboBox4.Items.Item(3) End Select End Sub Private Sub CheckedListBox1_SelectedIndexChanged(sender As System.Object, e As System.EventArgs) Handles CheckedListBox1.SelectedIndexChanged If CheckedListBox1.Items.Item(0) = True Then End If

End Sub Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click End End Sub Private Sub Button4_Click(sender As System.Object, e As System.EventArgs) Handles Button4.Click End End Sub End Class

CORRIDO:

Diseñado por: Cristhian Tamami

Página 54


[LENGUAJE DE PROGRAMACIÓN I]

27 de mayo de 2014

15.2.- SOCIO ECONOMICO ENUNCIADO: 15.2.- Diseñar una aplicación utilizando todas las herramientas e visual studio 2010 sobre socio económico.

ANALISIS: Componentes  FORM

Name Label2

Name Form1

Forecolor color-negro

Caption Colores de Letra

Caption Socio economico

Backcolor (A su gusto) Windowstate Maximize  LABEL Cantidad 3 Name Label1

Name Label3 Forecolor color-negro Caption socio economico  BUTTON

Forecolor color-negro

Cantidad 2

Caption Socio Economico

Name cmdnuevo

Diseñado por: Cristhian Tamami

Página 55


[LENGUAJE DE PROGRAMACIÓN I]

27 de mayo de 2014

Backcolor plomo-negro color Caption Nuevo

 COMBOBOX Cantidad 2

Name cmdsalir

Name ComboBox1

Backcolor plomo-negro color

Backcolor negro.blanco

Caption Salir

Caption (vacio)

 TEXTBOX

Name ComboBox2

Cantidad 4

Backcolor negro.blanco

Name Text1

Caption (vacio)

Caption (Vacío)  CHECKBOX Name Text2

Cantidad 2

Caption (Vacío)

Name CheckBox1 Backcolor negro-plomo

Name Text3

Caption propia

Caption (Vacío) Name CheckBox2 Name Text4

Backcolor negro-plomo

Caption (Vacío)

Caption arrendada

CODIFICACION: Private Sub TextBox2_KeyPress(sender As Object, e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox2.KeyPress If Char.IsLetter(e.KeyChar) Then e.Handled = False ElseIf Char.IsControl(e.KeyChar) Then e.Handled = False Else MsgBox("SOLO LETRAS") e.Handled = True End If End Sub

Diseñado por: Cristhian Tamami

Página 56


[LENGUAJE DE PROGRAMACIÓN I]

27 de mayo de 2014

Private Sub NumericUpDown1_ValueChanged(sender As System.Object, e As System.EventArgs) Handles NumericUpDown1.ValueChanged TextBox5.Text = NumericUpDown1.Value End Sub Private Sub ComboBox2_SelectedIndexChanged(sender As System.Object, e As System.EventArgs) Handles ComboBox2.SelectedIndexChanged Select Case ComboBox2.SelectedIndex Case 0 txtocupacion.Text = ComboBox2.Items.Item(0) txtingreso.Text = "340,00" Case 1 txtocupacion.Text = ComboBox2.Items.Item(1) txtingreso.Text = "500,00" Case 2 txtocupacion.Text = ComboBox2.Items.Item(2) txtingreso.Text = "200,00" Case 3 txtocupacion.Text = ComboBox2.Items.Item(3) txtingreso.Text = "100,00" End Select End Sub Private Sub CheckBox1_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles CheckBox1.CheckedChanged If CheckBox1.Checked = True Then CheckBox2.Checked = False End If End Sub Private Sub CheckBox2_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles CheckBox2.CheckedChanged If CheckBox2.Checked = True Then CheckBox1.Checked = False End If End Sub Private Sub ComboBox3_SelectedIndexChanged(sender As System.Object, e As System.EventArgs) Handles ComboBox3.SelectedIndexChanged Select Case ComboBox3.SelectedIndex Case 0 txtprimaria.Text = ComboBox3.Items.Item(0) Case 1 txtprimaria.Text = ComboBox3.Items.Item(1) Case 2 txtprimaria.Text = ComboBox3.Items.Item(2) Case 3 txtprimaria.Text = ComboBox3.Items.Item(3) End Select End Sub Private Sub ComboBox4_SelectedIndexChanged(sender As System.Object, e As System.EventArgs) Handles ComboBox4.SelectedIndexChanged Select Case ComboBox4.SelectedIndex Case 0 txtsecundaria.Text = ComboBox4.Items.Item(0)

Diseñado por: Cristhian Tamami

Página 57


[LENGUAJE DE PROGRAMACIÓN I]

27 de mayo de 2014

Case 1 txtsecundaria.Text = ComboBox4.Items.Item(1) Case 2 txtsecundaria.Text = ComboBox4.Items.Item(2) Case 3 txtsecundaria.Text = ComboBox4.Items.Item(3) End Select End Sub Private Sub CheckedListBox1_SelectedIndexChanged(sender As System.Object, e As System.EventArgs) Handles CheckedListBox1.SelectedIndexChanged If CheckedListBox1.Items.Item(0) = True Then End If

End Sub Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click End End Sub Private Sub Button4_Click(sender As System.Object, e As System.EventArgs) Handles Button4.Click End End Sub End Class

CORRIDO:

Diseñado por: Cristhian Tamami

Página 58


[LENGUAJE DE PROGRAMACIÓN I]

27 de mayo de 2014

15.3.- ESTUDIOS RELIZADOS ENUNCIADO: 15.3.- Diseñar una aplicación utilizando todas las herramientas e visual studio 2010 sobre los estudios realizados.

ANALISIS: Componentes

Caption Estudios realizados

 FORM Name Form1

Name Label2

Caption Estudios Realizados

Forecolor color-negro

Backcolor imagen

Caption Estudios Realizados

Windowstate Maximize  LABEL

Name Label3

Cantidad 3

Forecolor color-negro

Name Label1

Caption Estudios Realizados

Forecolor color-negro

Diseñado por: Cristhian Tamami

 BUTTON

Página 59


[LENGUAJE DE PROGRAMACIÓN I]

27 de mayo de 2014

Cantidad 2

Backcolor negro.blanco

Name cmdnuevo

Caption (vacio)

Backcolor plomo-negro color Caption Nuevo

Name ComboBox2 Backcolor negro.blanco

Name cmdsalir

Caption (vacio)

Backcolor plomo-negro color Caption Salir

 CHECKBOX Cantidad 3

 TEXTBOX

Name CheckBox1

Cantidad 2

Backcolor negro-plomo

Name Text1

Caption fiscal

Caption (Vacío) Name CheckBox2 Name Text2

Backcolor negro-plomo

Caption (Vacío)

Caption particular

 COMBOBOX

Name CheckBox3

Cantidad 2

Backcolor negro-plomo

Name ComboBox1

Caption fiscomisional

CODIFICACION: Public Class Form1 Private Sub ComboBox1_SelectedIndexChanged(sender As System.Object, e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged Select Case ComboBox1.SelectedIndex Case 0 txtestadocivil.Text = ComboBox1.Items.Item(0) Case 1 txtestadocivil.Text = ComboBox1.Items.Item(1) Case 2 txtestadocivil.Text = ComboBox1.Items.Item(2)

Diseñado por: Cristhian Tamami

Página 60


[LENGUAJE DE PROGRAMACIÓN I]

27 de mayo de 2014

Case 3 txtestadocivil.Text = ComboBox1.Items.Item(3) End Select End Sub Private Sub DateTimePicker1_ValueChanged(sender As System.Object, e As System.EventArgs) Handles DateTimePicker1.ValueChanged txtfecha.Text = DateTimePicker1.Value End Sub Private Sub TextBox1_KeyPress(sender As Object, e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress If Char.IsLetter(e.KeyChar) Then e.Handled = False ElseIf Char.IsControl(e.KeyChar) Then e.Handled = False Else MsgBox("SOLO LETRAS") e.Handled = True End If End Sub Private Sub TextBox2_KeyPress(sender As Object, e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox2.KeyPress If Char.IsLetter(e.KeyChar) Then e.Handled = False ElseIf Char.IsControl(e.KeyChar) Then e.Handled = False Else MsgBox("SOLO LETRAS") e.Handled = True End If End Sub Private Sub NumericUpDown1_ValueChanged(sender As System.Object, e As System.EventArgs) Handles NumericUpDown1.ValueChanged TextBox5.Text = NumericUpDown1.Value End Sub Private Sub ComboBox2_SelectedIndexChanged(sender As System.Object, e As System.EventArgs) Handles ComboBox2.SelectedIndexChanged Select Case ComboBox2.SelectedIndex Case 0 txtocupacion.Text = ComboBox2.Items.Item(0) txtingreso.Text = "340,00" Case 1 txtocupacion.Text = ComboBox2.Items.Item(1) txtingreso.Text = "500,00" Case 2 txtocupacion.Text = ComboBox2.Items.Item(2) txtingreso.Text = "200,00" Case 3 txtocupacion.Text = ComboBox2.Items.Item(3) txtingreso.Text = "100,00" End Select

Diseñado por: Cristhian Tamami

Página 61


[LENGUAJE DE PROGRAMACIÓN I]

27 de mayo de 2014

End Sub Private Sub CheckBox1_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles CheckBox1.CheckedChanged If CheckBox1.Checked = True Then CheckBox2.Checked = False End If End Sub Private Sub CheckBox2_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles CheckBox2.CheckedChanged If CheckBox2.Checked = True Then CheckBox1.Checked = False End If End Sub Private Sub ComboBox3_SelectedIndexChanged(sender As System.Object, e As System.EventArgs) Handles ComboBox3.SelectedIndexChanged Select Case ComboBox3.SelectedIndex Case 0 txtprimaria.Text = ComboBox3.Items.Item(0) Case 1 txtprimaria.Text = ComboBox3.Items.Item(1) Case 2 txtprimaria.Text = ComboBox3.Items.Item(2) Case 3 txtprimaria.Text = ComboBox3.Items.Item(3) End Select End Sub Private Sub ComboBox4_SelectedIndexChanged(sender As System.Object, e As System.EventArgs) Handles ComboBox4.SelectedIndexChanged Select Case ComboBox4.SelectedIndex Case 0 txtsecundaria.Text = ComboBox4.Items.Item(0) Case 1 txtsecundaria.Text = ComboBox4.Items.Item(1) Case 2 txtsecundaria.Text = ComboBox4.Items.Item(2) Case 3 txtsecundaria.Text = ComboBox4.Items.Item(3) End Select End Sub Private Sub CheckedListBox1_SelectedIndexChanged(sender As System.Object, e As System.EventArgs) Handles CheckedListBox1.SelectedIndexChanged If CheckedListBox1.Items.Item(0) = True Then End If

End Sub

Diseñado por: Cristhian Tamami

Página 62


[LENGUAJE DE PROGRAMACIÓN I]

27 de mayo de 2014

CORRIDO:

Diseñado por: Cristhian Tamami

Página 63


Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.