código para interface

Páginas: 5 (1214 palabras) Publicado: 24 de mayo de 2013
EJERCICIO DE VISUAL BASIC
Reloj y Calendario
             
Crea un formulario con cuatro etiquetas, un reloj con intervalo de 1000 y escribe el siguiente código:
Private Sub Timer1_Timer()
Label2.Caption = Time
Label4.Caption = Date
End Sub
Tipo de Cambio

Crea un formulario con tres etiquetas, tres cajas de texto, cuatro botones y escribe el siguiente código:
Escribe el siguientecódigo:
El botón Ver Pesos
Private Sub Command1_Click()
Text1 = Val(Text2) * Val(Text3)
End Sub
El botón Ver Dólares
Private Sub Command2_Click()
Text2 = Val(Text1) / Val(Text3)
End Sub
El botón Nuevo Cálculo
Private Sub Command3_Click()
Text1 = ""
Text2 = ""
Text3 = ""
Text1.SetFocus
End Sub
El botón Salir
Private Sub Command4_Click()
Unload Me
End
End Sub




Calculadora
 Crea un formulario con cuatro etiquetas, tres cajas de texto, una caja de combo, tres botones y escribe el siguiente código:
Private Sub Form_Load()
Combo1.AddItem "Dividir"
Combo1.AddItem "Multiplicar"
Combo1.AddItem "Restar"
Combo1.AddItem "Sumar"
End Sub
El botón Nuevo Cálculo
Private Sub Command1_Click()
text1 = ""
text2 = ""
text3 = ""
text1.SetFocus
End Sub


El botónCalcular
Private Sub Command2_Click()
If Combo1 = "Sumar" Then
Text3 = Val(Text1) + Val(Text2)
ElseIf Combo1 = "Restar" Then
Text3 = Val(Text1) - Val(Text2)
ElseIf Combo1 = "Multiplicar" Then
Text3 = Val(Text1) * Val(Text2)
ElseIf Combo1 = "Dividir" Then
Text3 = Val(Text1) / Val(Text2)
End If
End Sub
El botón Salir
Private Sub Command3_Click()
Unload Me
End
End SubConcatenación
 
Crea un formulario con cuatro etiquetas, cuatro cajas de texto, tres botones y escribe el siguiente código:
El botón Concatenar Datos
Private Sub Command1_Click()
Text4 = Text1 & " " & Text2 & " " & Text3
End Sub
El botón Nuevos Datos
Private Sub Command2_Click()
Text1 = ""
Text2 = ""
Text3 = ""
Text4 = ""
Text1.SetFocus
End Sub
El botón Salir del Programa
Private SubCommand3_Click()
Unload Me
End
End Sub
Calculadora II
 
Crea un formulario con tres etiquetas, tres cajas de texto, seis botones y escribe el siguiente código:
El botón Nuevo Cálculo
Private Sub Command5_Click()
Text1 = ""
Text2 = ""
Text3 = ""
Text1.SetFocus
End Sub
El botón Sumar
Private Sub Command1_Click()
Text3 = Val(Text1) + Val(Text2)
End Sub
El botón Restar
Private SubCommand2_Click()
Text3 = Val(Text1) - Val(Text2)
End Sub
El botón Multiplicar
Private Sub Command3_Click()
Text3 = Val(Text1) * Val(Text2)
End Sub
El botón Multiplicar
Private Sub Command4_Click()
Text3 = Val(Text1) / Val(Text2)
End Sub
El botón Salir
Private Sub Command6_Click()
Unload Me
End
End Sub
Alarma
 
Crea un formulario con tres etiquetas, dos cajas de texto, dosbotones, un reloj con intervalo de 1000 y escribe el siguiente código:
El botón Establecer la Alarma y Minimizar
Private Sub Command1_Click()
Form1.WindowState = 1
Timer1.Enabled = True
End Sub
El botón Salir
Private Sub Command2_Click()
Unload Me
End
End Sub
El reloj
Private Sub Timer1_Timer()
Dim horas As String
hora = Format(Time, "hh:mm")
If hora = Text1.Text Then
Beep
MsgBoxText2.Text, vbOKOnly + vbInformation, "Aviso de la Alarma"
Timer1.Enabled = False
Form1.WindowState = 0
End If
End Sub


Calculadora III
  
Crea un formulario con tres etiquetas, tres cajas de texto, un marco, cuatro botones de opción, tres botones y escribe el siguiente código:
El botón Calcular
Private Sub Command1_Click()
If Option1 = True Then
Text3 = Val(Text1) / Val(Text2)
ElseIfOption2 = True Then
Text3 = Val(Text1) * Val(Text2)
ElseIf Option3 = True Then
Text3 = Val(Text1) - Val(Text2)
ElseIf Option4 = True Then
Text3 = Val(Text1) + Val(Text2)
End If
End Sub
El botón Otra Operación
Private Sub Command2_Click()
Text1 = ""
Text2 = ""
Text3 = ""
Text1.SetFocus
End Sub
El botón Salir
Private Sub Command3_Click()
Unload Me
End
End Sub
Conversiones
  ...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • INSTRUCTIVO PARA GENERACION DE INTERFACE
  • Lineamientos para el diseño de interfaces
  • Interfaces Para Discapacitados
  • Consejos Para El Dise O De Interfaces De Usuario
  • Código De Ética Para Farmaceutico
  • codigos para ingresar a centos
  • Codigos y claves para scauts
  • Código De Ética Para Administrador

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS