0% found this document useful (0 votes)
42 views

Nombre: David Orlando Calderón Rivas

The document describes several Visual Basic programs created by David Orlando Calderón Rivas under the guidance of his professor Lester Holtmman. The programs include ones for addition, subtraction, multiplication, division, password access, a calculator, movement, arithmetic operations, and a menu editor. Each program section includes the interface and coding details.

Uploaded by

David Calderón
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
42 views

Nombre: David Orlando Calderón Rivas

The document describes several Visual Basic programs created by David Orlando Calderón Rivas under the guidance of his professor Lester Holtmman. The programs include ones for addition, subtraction, multiplication, division, password access, a calculator, movement, arithmetic operations, and a menu editor. Each program section includes the interface and coding details.

Uploaded by

David Calderón
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 16

Nombre: David Orlando Calderón Rivas.

Profesor: Lester Holtmman.

Audio: 2.

Trabajo: Investigación de Microsoft Visual


Basic.
Programa de Suma.

Interfaz:

Codificación:

Private Sub Command1_Click()


Dim a, b, c
a = Val(Text1.Text)
b = Val(Text2.Text)
c=a+b
Text3.Text = c
End Sub

Private Sub Command2_Click()


Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text1.SetFocus
End Sub

Private Sub Command3_Click()


MsgBox "Hasta la Vista"
End
End Sub

Programa de Resta.

Interfaz:

Codificación:

Private Sub Command1_Click()


Dim a, b, c
a = Val(Text1.Text)
b = Val(Text2.Text)
c=a-b
Text3.Text = c
End Sub

Private Sub Command2_Click()


Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text1.SetFocus
End Sub

Private Sub Command3_Click()


MsgBox "Hasta la Vista Baby."
End
End Sub

Programa de Multiplicación.

Interfaz:

Codificación:
Private Sub Command1_Click()
Dim a, b, c
a = Val(Text1.Text)
b = Val(Text2.Text)
c=a*b
Text3.Text = c
End Sub

Private Sub Command2_Click()


Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text1.SetFocus
End Sub

Private Sub Command3_Click()


MsgBox "Hasta la Vista Baby."
End
End Sub
Programa de Divición:

Interfaz:

Codificación:

Private Sub Command1_Click()


Dim a, b, c
a = Val(Text1.Text)
b = Val(Text2.Text)
c=a/b
Text3.Text = c
End Sub

Private Sub Command2_Click()


Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text1.SetFocus
End Sub

Private Sub Command3_Click()


MsgBox "Hasta la Vista Baby."
End
End Sub

Programa de Clave de Acceso.

Interfaz:

Codificación:

Private Sub Command1_Click()


If Text1.Text = "DOC" Then
MsgBox "Bienvenido"
Form1.Visible = False
Form2.Visible = True
Else
MsgBox "Metio la pata."
Command1.Enabled = False
Command2.Enabled = False
Text1.Text = ""
End If
End Sub

Private Sub Command2_Click()


Dim a, b, c, d
a = "salida"
b = vbYesNo
c = "Mensaje"
d = MsgBox(a, b, c)

If d = vbYes Then
MsgBox "Hasta pronto"
End
End If

If d = vbNo Then
Form1.Visible = True
Form1.Enabled = True
End If
End Sub

Private Sub Text1_Change()


If Text1.Text <> "" Then
Command1.Enabled = True
Command2.Enabled = True
End If
End Sub
Programa de Calculadora.

Interfaz:

Codificación:
Dim OPERA As Byte
Dim NUM1, NUM2 As Double

Private Sub Command1_Click()

End Sub

Private Sub DIVDEC_Click()


NUM1 = Val(VISOR.Text)
OPERA = 4
VISOR.Text = ""
End Sub

Private Sub DIVENT_Click()


NUM1 = Val(VISOR.Text)
OPERA = 5
VISOR.Text = 5
End Sub

Private Sub Form_Load()


NUM1 = 0
NUM2 = 0
End Sub

Private Sub IGUAL_Click()


resp = 0
NUM2 = Val(VISOR.Text)
If OPERA = 1 Then
resp = NUM1 + NUM2
End If
If OPERA = 2 Then
resp = NUM1 - NUM2
End If
If OPERA = 3 Then
resp = NUM1 * NUM2
End If
If OPERA = 4 Then
If NUM2 = 0 Then
MsgBox "Error...No puede dividirse por 0"
Exit Sub
End If
resp = NUM1 / NUM2
End If
If OPERA = 5 Then
If NUM2 = 0 Then
MsgBox "Error...No puede dividirse por 0"
Exit Sub
End If
resp = NUM1 \ NUM2
End If
If OPERA = 6 Then
If NUM2 = 0 Then
MsgBox "Error...No puede dividirse por 0", vbCritical
Exit Sub
End If
resp = NUM1 Mod NUM2
End If
VISOR.Text = resp
End Sub

Private Sub Limpiar_Click()


VISOR.Text = ""
NUM1 = 0
NUM2 = 0
resp = 0
End Sub

Private Sub MODULO_Click()


NUM1 = Val(VISOR.Text)
OPERA = 6
VISOR.Text = ""
End Sub

Private Sub MULTI_Click()


NUM1 = Val(VISOR.Text)
OPERA = 3
VISOR.Text = ""
End Sub

Private Sub N1_Click()


VISOR.Text = VISOR.Text + Str(1)
End Sub
Private Sub N2_Click()
VISOR.Text = VISOR.Text + Str(2)
End Sub
Private Sub N3_Click()
VISOR.Text = VISOR.Text + Str(3)
End Sub
Private Sub N4_Click()
VISOR.Text = VISOR.Text + Str(4)
End Sub
Private Sub N5_Click()
VISOR.Text = VISOR.Text + Str(5)
End Sub
Private Sub N6_Click()
VISOR.Text = VISOR.Text + Str(6)
End Sub
Private Sub N7_Click()
VISOR.Text = VISOR.Text + Str(7)
End Sub
Private Sub N8_Click()
VISOR.Text = VISOR.Text + Str(8)
End Sub
Private Sub N9_Click()
VISOR.Text = VISOR.Text + Str(9)
End Sub
Private Sub N0_Click()
VISOR.Text = VISOR.Text + Str(0)
End Sub

Private Sub RESTA_Click()


NUM1 = Val(VISOR.Text)
OPERA = 2
VISOR.Text = ""
End Sub

Private Sub Salir_Click()


MsgBox ".....LARGO....."
End
End Sub

Private Sub SUMA_Click()


NUM1 = Val(VISOR.Text)
OPERA = 1
VISOR.Text = ""
End Sub
Programa de Movimiento.

Interfaz:

Codificación:

Private Sub Timer1_Timer()


Command1.Move Command1.Left + 100
If Command1.Left > ScaleWidth Then
Command1.Move 0
End If
End Sub

Programa de Aritmética.

Interfaz:

Codificación:

Private Sub Command1_Click()


Dim a, b, c
a = Val(Text1.Text)
b = Val(Text2.Text)
c=a+b
Text3.Text = c
End Sub

Private Sub Command2_Click()


a = Val(Text1.Text)
b = Val(Text2.Text)
c=a-b
Text3.Text = c
End Sub

Private Sub Command3_Click()


a = Val(Text1.Text)
b = Val(Text2.Text)
c=a*b
Text3.Text = c
End Sub

Private Sub Command4_Click()


a = Val(Text1.Text)
b = Val(Text2.Text)
c=a/b
Text3.Text = c
End Sub

Private Sub Command5_Click()


Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text1.SetFocus
End Sub

Private Sub Command6_Click()


MsgBox "Que tenga buen día."
End
End Sub
Menú Editor.

Interfaz:

Codificación:
Private Sub Calculadora_Click()
Shell ("C:\WINDOWS\SYSTEM32\calc.exe"), vbMaximizedFocus
End Sub

Private Sub Excel_Click()


Shell ("C:\STREET\Microsoft Office\Office\Excel.Exe"), vbMaximizedFocus
End Sub

Private Sub MarioT_Click()

End Sub

Private Sub Paint_Click()


Shell ("C:\WINDOWS\SYSTEM32\mspaint.exe"), vbMaximizedFocus
End Sub

Private Sub Word_Click()


Shell ("C:\STREET\Microsoft Office\Office\WinWord"), vbMaximizedFocus
End Sub

You might also like