Está en la página 1de 25

PROGRAMA 1

Private Sub Command1_Click()

Print "Mi primer programa"

Text1.Text = "Mi primer programa"

End Sub

PROGRAMA 2

Private Sub Command1_Click()

Text3.Text = Val(Text1.Text) + Val(Text2.Text)

End Sub

PROGRAMA 3
Dim a As Single

Private Sub Command1_Click()

a = Text1.Text

Text2.Text = a * 0.394

Text3.Text = a * 0.0328084

Text4.Text = a * 0.0109361

Text5.Text = a * 0.01

End Sub

Private Sub Command2_Click()

Text1.Text = ""

Text2.Text = ""

Text3.Text = ""
Text4.Text = ""

Text5.Text = ""

End Sub

Private Sub Command3_Click()

End

End Sub

PROGRAMA 4
Private Sub Command1_Click()

Label1.Caption = "LADO 1"

Label2.Caption = "LADO 2"

Label3.Caption = "EL AREA DEL CUADRADO ES:"

Text3.Text = Val(Text1) * Val(Text2)

Text4.Visible = "FALSE"

Label4.Visible = "FALSE"

End Sub

Private Sub Command2_Click()

Label1.Caption = " BASE"

Label2.Caption = "ALTURA"

Label3.Caption = " EL AREA DEL RECTANGULO ES:"

Text3.Text = Val(Text1) * Val(Text2)

Text4.Visible = "FALSE"

Label4.Visible = "FALSE"

End Sub

Private Sub Command3_Click()

Label1.Caption = " BASE"

Label2.Caption = "ALTURA"

Label3.Caption = " EL AREA DEL TRIANGULO ES:"

Text3.Text = Val(Text1) * Val(Text2) / 2


Text4.Visible = "FALSE"

Label4.Visible = "FALSE"

End Sub

Private Sub Command4_Click()

Label1.Caption = " BASE MAYOR"

Label2.Caption = "BASE MENOR"

Label3.Caption = " EL AREA DEL TRAPECIO ES:"

Label4.Caption = "ALTURA"

Text3.Text = (Val(Text1) + Val(Text2)) * Val(Text4) / 2

Text4.Visible = "TRUE"

Label4.Visible = "TRUE"

End Sub

Private Sub Command5_Click()

Label1.Caption = ""

Label2.Caption = ""

Label3.Caption = " "

Label4.Caption = ""

Text3.Text = ""

Text4.Text = ""

Text1.Text = ""

Text2.Text = ""

End Sub

Private Sub Command6_Click()

End

End Sub
PROGRAMA 5
Private Sub Command1_Click()

Label1.Visible = "TRUE"

Image1.Visible = "TRUE"

Image2.Visible = "False"

Label1.Visible = "true"

Label2.Visible = "true"

Label3.Visible = "true"

Label4.Visible = "true"

Label2.Caption = "El Día Internacional de la Mujer se realizó en Europa, específicamente en


Alemania, Austria, Dinamarca y Suiza"

Label3.Caption = " DESDE EL AÑO 1911"

Label4.Caption = " SE CELEBRA EL DIA 8 DE MARZO"

End Sub

Private Sub Command2_Click()

Label1.Visible = "TRUE"

Image2.Visible = "TRUE"

Image1.Visible = "False"

Label1.Visible = "true"

Label2.Visible = "true"

Label3.Visible = "true"

Label4.Visible = "true"

Label1.Caption = "DIA INTERNACIONAL DE LA MUJER"

Label2.Caption = "La mejor protección que cualquier mujer puede tener es el coraje"

Label3.Caption = "Por muy poderosa que sea el arma de la belleza, desgraciada la mujer que sólo a
este recurso debe el triunfo alcanzado sobre el hombre"

Label4.Caption = "Las mujeres han vivido todos estos siglos como esposas, con el poder mágico y
delicioso de reflejar la figura del hombre, el doble de su tamaño natural"

End Sub
Private Sub Command3_Click()

Label1.Visible = "false"

Image2.Visible = "false"

Image1.Visible = "False"

Label1.Visible = "false"

Label2.Visible = "false"

Label3.Visible = "false"

Label4.Visible = "false"

End Sub

Private Sub Command4_Click()

End

End Sub

Private Sub Form_Load()

Label1.Visible = "FALSE"

Label2.Visible = "FALSE"

Label3.Visible = "FALSE"

Label4.Visible = "FALSE"

Image1.Visible = "FALSE"

Image2.Visible = "FALSE"

End Sub

PROGRAMA 6
Dim CAL As Double

Private Sub Command1_Click()

Text1.Text = ""

End Sub

Private Sub Command2_Click()

CAL = Text1.Text

If CAL >= 0 And CAL < 6 Then

MsgBox "REPROBADO"
End If

If CAL >= 6 And CAL <= 7 Then

MsgBox "APENITAS"

End If

If CAL > 7 And CAL <= 8 Then

MsgBox "BIEN"

End If

If CAL > 8 And CAL <= 9 Then

MsgBox "MUY BIEN"

End If

If CAL > 9 And CAL <= 10 Then

MsgBox "EXCELENTE :)"

End If

End Sub

Private Sub Command3_Click()

End

End Sub

PROGRAMA 7
Private Sub Command1_Click()

Text2.Text = Val(Text1.Text) * 600

Text4.Text = Val(Text3.Text) * 500

Text6.Text = Val(Text5.Text) * 400

Text8.Text = Val(Text7.Text) * 200

Text10.Text = Val(Text9.Text) * 350

Text12.Text = Val(Text11.Text) * 900

End Sub

Private Sub Command2_Click()

Text13.Text = Val(Text2.Text) + Val(Text4.Text) + Val(Text6.Text) + Val(Text8.Text) +


Val(Text10.Text) + Val(Text12.Text)
If Text13.Text >= 3000 Then

Label10.Caption = "VENTA CON DESCUENTO DEL 10%"

Text14.Text = Val(Text13.Text) - (Val(Text13.Text) * 0.1)

End If

If Text13.Text >= 5000 Then

Label10.Caption = "VENTA CON DESCUENTO DEL 15%"

Text14.Text = Val(Text13.Text) - (Val(Text13.Text) * 0.15)

End If

If Text13.Text >= 7000 Then

Label10.Caption = "VENTA CON DESCUENTO DEL 20%"

Text14.Text = Val(Text13.Text) - (Val(Text13.Text) * 0.2)

End If

If Text13.Text < 3000 Then

Label10.Caption = " VENTA SIN DESCUENTO"

Text14.Text = Val(Text13.Text)

End If

End Sub

Private Sub Command3_Click()

Text1.Text = ""

Text2.Text = ""

Text3.Text = ""

Text4.Text = ""

Text5.Text = ""

Text6.Text = ""

Text7.Text = ""

Text8.Text = ""

Text9.Text = ""

Text10.Text = ""

Text11.Text = ""
Text12.Text = ""

Text13.Text = ""

Text14.Text = ""

Label10.Caption = ""

End Sub

Private Sub Command4_Click()

End

End Sub

PROGRAMA 8
Private Sub Command1_Click()

Select Case Text2.Text

Case 1

Label3.Caption = "EL RESULTADO EN PULGADAS ES"

Text3.Text = Val(Text1.Text) * 0.394

Case 2

Label3.Caption = "EL RESULTADO EN PIES ES"

Text3.Text = Val(Text1.Text) * 0.0328084

Case 3

Label3.Caption = "EL RESULTADO EN YARDAS ES"

Text3.Text = Val(Text1.Text) * 0.0109361

Case 4

Label3.Caption = "EL RESULTADO EN PIES ES"

Text3.Text = Val(Text1.Text) * 0.01

End Select

End Sub

Private Sub Command2_Click()

Text1.Text = ""

Text2.Text = ""

Text3.Text = ""
Label3.Caption = ""

End Sub

Private Sub Command3_Click()

End

End Sub

Private Sub Form_Load()

Label1.Caption = "DAME LOS CENTIMETROS A CONVERTIR"

Label2.Caption = "DAME LA OPCION A REALIZAR"

End Sub

PROGRAMA 9
Private Sub Command1_Click()

If Text1.Text = "MARIO" And Text2.Text = "12345" Then

Form2.Show

Form1.Hide

Else

MsgBox "DATOS INCORRECTOS :V"

End If

End Sub

PROGRAMA 10
Dim OPCION As Integer

Private Sub Command1_Click()

Text1.Text = ""

Text2.Text = ""

Text3.Text = ""

Text4.Text = ""

End Sub

Private Sub Command2_Click()

OPCION = Text1.Text
Select Case OPCION

Case 1

Text4.Text = Val(Text2.Text) + Val(Text3.Text)

Case 2

Text4.Text = Val(Text2.Text) - Val(Text3.Text)

Case 3

Text4.Text = Val(Text2.Text) * Val(Text3.Text)

Case 4

Text4.Text = Val(Text2.Text) / Val(Text3.Text)

End Select

If OPCION > 4 Then

MsgBox "Error"

End If

PROGRAMA 11
Dim NUM As Integer

Dim SUMA As Double

Private Sub Command1_Click()

SUMA = 0

For NUM = 1 To 20 Step 2

SUMA = SUMA + NUM

Picture1.Print SUMA

Next NUM

Print SUMA

End Sub

Private Sub Command2_Click()

End

End Sub

Private Sub Command3_Click()

NUM = 1
SUMA = 0

Do While NUM <= 20

SUMA = SUMA + NUM

NUM = NUM + 2

Picture1.Print SUMA

Loop

End Sub

PROGRAMA 12
Dim NUM As Integer

Dim CUA As Single

Dim SUMA As Single

Private Sub Command1_Click()

SUMA = 0

For NUM = 1 To 10 Step 1

CUA = NUM * NUM

SUMA = SUMA + CUA

Picture1.Print NUM, CUA, SUMA

Next NUM

End Sub

Private Sub Command2_Click()

End

End Sub
PROGRAMA 13
Dim NUM As Integer

Dim TABLA As Integer

Dim RES As Integer

Private Sub Command1_Click()

NUM = 1

RES = 0

TABLA = Text1.Text

Picture1.Print "TABLA", "MULTIPLO", "RESULTADO"

While NUM <= 10

RES = TABLA * NUM

Picture1.Print TABLA, NUM, RES

NUM = NUM + 1

Wend

Form1.Hide

Form2.Show

End Sub

Private Sub Command2_Click()

Picture1.Cls

End Sub

Private Sub Command3_Click()

End

End Sub

PROGRAMA 14
Dim A As Integer

Dim B As Integer

Dim RESULTADO As Integer

Private Sub Command1_Click()

Picture1.Print "TABLA", "MULTIPLO", "RESULTADO"


For A = 1 To 5

For B = 1 To 10

RESULTADO = A * B

Picture1.Print A, B, RESULTADO

Next B

Picture1.Print "_______________________"

Next A

End Sub

Private Sub Command2_Click()

End Sub

Private Sub Command3_Click()

End

End Sub
PROGRAMA 15
Private Sub Combo1_CLICK()

If Combo1 = "SUMA" Then

Text3.Text = Val(Text1.Text) + Val(Text2.Text)

Else

If Combo1 = "RESTA" Then

Text3.Text = Val(Text1.Text) - Val(Text2.Text)

Else

If Combo1 = "PRODUCTO" Then

Text3.Text = Val(Text1.Text) * Val(Text2.Text)

Else

If Combo1 = "DIVISION" Then

Text3.Text = Val(Text1.Text) / Val(Text2.Text)

End If

End If

End If

End If

End Sub

Private Sub Command1_Click()

Text1.Text = ""

Text2.Text = ""

Text3.Text = ""

Label1.Caption = ""

End Sub

Private Sub Command2_Click()

End

Form1.Hide

Form2.Show

End Sub
Private Sub Form_Load()

Label2.Caption = "DAME EL PRIMER VALOR"

Label3.Caption = "DAME EL SEGUNDO VALOR"

End Sub

Private Sub Option1_Click()

Text3.Text = Val(Text1.Text) + Val(Text2.Text)

Label1.Caption = "EL RESULTADO DE LA SUMA ES"

End Sub

Private Sub Option2_Click()

Text3.Text = Val(Text1.Text) - Val(Text2.Text)

Label1.Caption = "EL RESULTADO DE LA RESTA ES"

End Sub

Private Sub Option3_Click()

Text3.Text = Val(Text1.Text) * Val(Text2.Text)

Label1.Caption = "EL RESULTADO DEL PRODUCTO ES"

End Sub

Private Sub Option4_Click()

Text3.Text = Val(Text1.Text) / Val(Text2.Text)

Label1.Caption = "EL RESULTADO DE LA DIVISION ES"

End Sub
PROGRAMA 16
Dim A As Integer

Dim B As Integer

Dim RESULTADO As Integer

Private Sub CM_METROS_Click()

Label1.Visible = True

Label2.Visible = True

Label3.Visible = False

Text1.Visible = True

Text2.Visible = True

Text3.Visible = False

Picture1.Visible = False

Label1.Caption = "DAME LOS CM A CONVERTIR"

Label2.Caption = "LOS CM EN METROS SON"

Text2.Text = Val(Text1.Text) * 0.01

End Sub

Private Sub CM_PIES_Click()

Label1.Visible = True

Label2.Visible = True

Label3.Visible = False

Text1.Visible = True

Text2.Visible = True

Text3.Visible = False

Picture1.Visible = False

Label1.Caption = "DAME LOS CM A CONVERTIR"

Label2.Caption = "LOS CM EN PIES SON"

Text2.Text = Val(Text1.Text) * 0.0328084

End Sub
Private Sub CM_PULGADAS_Click()

Label1.Visible = True

Label2.Visible = True

Label3.Visible = False

Text1.Visible = True

Text2.Visible = True

Text3.Visible = False

Picture1.Visible = False

Label1.Caption = "DAME LOS CM A CONVERTIR"

Label2.Caption = "LOS CM EN PULGADAS SON"

Text2.Text = Val(Text1.Text) * 0.394

End Sub

Private Sub CM_YARDAS_Click()

Label1.Visible = True

Label2.Visible = True

Label3.Visible = False

Text1.Visible = True

Text2.Visible = True

Text3.Visible = False

Picture1.Visible = False

Label1.Caption = "DAME LOS CM A CONVERTIR"

Label2.Caption = "LOS CM EN YARDAS SON"

Text2.Text = Val(Text1.Text) * 0.0109361

End Sub

Private Sub DEL_3_Click()

Label1.Visible = False

Label2.Visible = False

Label3.Visible = False

Text1.Visible = False
Text2.Visible = False

Text3.Visible = False

Picture1.Visible = True

Picture1.Print "TABLA", "MULTIPLO", "RESULTADO"

A=3

For B = 1 To 10

RESULTADO = A * B

Picture1.Print A, B, RESULTADO

Next B

Picture1.Print "________________________________"

End Sub

Private Sub DEL_5_Click()

Label1.Visible = False

Label2.Visible = False

Label3.Visible = False

Text1.Visible = False

Text2.Visible = False

Text3.Visible = False

Picture1.Visible = True

Picture1.Print "TABLA", "MULTIPLO", "RESULTADO"

A=5

For B = 1 To 10

RESULTADO = A * B

Picture1.Print A, B, RESULTADO

Next B

Picture1.Print "________________________________"

End Sub
Private Sub DEL_7_Click()

Label1.Visible = False

Label2.Visible = False

Label3.Visible = False

Text1.Visible = False

Text2.Visible = False

Text3.Visible = False

Picture1.Visible = True

Picture1.Print "TABLA", "MULTIPLO", "RESULTADO"

A=7

For B = 1 To 10

RESULTADO = A * B

Picture1.Print A, B, RESULTADO

Next B

Picture1.Print "________________________________"

End Sub

Private Sub DEL_9_Click()

Label1.Visible = False

Label2.Visible = False

Label3.Visible = False

Text1.Visible = False

Text2.Visible = False

Text3.Visible = False

Picture1.Visible = True

Picture1.Print "TABLA", "MULTIPLO", "RESULTADO"

A=9

For B = 1 To 10

RESULTADO = A * B

Picture1.Print A, B, RESULTADO
Next B

Picture1.Print "________________________________"

End Sub

Private Sub DIVISION_Click()

Label1.Visible = True

Label2.Visible = True

Label3.Visible = True

Text1.Visible = True

Text2.Visible = True

Text3.Visible = True

Picture1.Visible = False

Label1.Caption = "DAME EL PRIMER VALOR"

Label2.Caption = "DAME EL SEGUNDO VALOR"

Label3.Caption = "EL RESULTADO DE LA DIVISION ES"

Text3.Text = Val(Text1.Text) / Val(Text2.Text)

End Sub

Private Sub Form_Load()

Label1.Visible = False

Label2.Visible = False

Label3.Visible = False

Text1.Visible = False

Text2.Visible = False

Text3.Visible = False

Picture1.Visible = False

End Sub

Private Sub LIMPIAR_Click()

Text1.Text = ""

Text2.Text = ""

Text3.Text = ""
Label1.Caption = ""

Label2.Caption = ""

Label3.Caption = ""

Picture1.Cls

End Sub

Private Sub PRODUCTO_Click()

Label1.Visible = True

Label2.Visible = True

Label3.Visible = True

Text1.Visible = True

Text2.Visible = True

Text3.Visible = True

Picture1.Visible = False

Label1.Caption = "DAME EL PRIMER VALOR"

Label2.Caption = "DAME EL SEGUNDO VALOR"

Label3.Caption = "EL RESULTADO DEL PRODUCTO ES"

Text3.Text = Val(Text1.Text) * Val(Text2.Text)

End Sub

Private Sub RESTA_Click()

Label1.Visible = True

Label2.Visible = True

Label3.Visible = True

Text1.Visible = True

Text2.Visible = True

Text3.Visible = True

Picture1.Visible = False

Label1.Caption = "DAME EL PRIMER VALOR"

Label2.Caption = "DAME EL SEGUNDO VALOR"

Label3.Caption = "EL RESULTADO DE LA RESTA ES"


Text3.Text = Val(Text1.Text) - Val(Text2.Text)

End Sub

Private Sub SALIR_Click()

End

End Sub

Private Sub SUMA_Click()

Label1.Visible = True

Label2.Visible = True

Label3.Visible = True

Text1.Visible = True

Text2.Visible = True

Text3.Visible = True

Label1.Caption = "DAME EL PRIMER VALOR"

Label2.Caption = "DAME EL SEGUNDO VALOR"

Label3.Caption = "EL RESULTADO DE LA SUMA ES"

Text3.Text = Val(Text1.Text) + Val(Text2.Text)

End Sub

PROGRAMA 17
Dim PAISES(6) As String

Private Sub Command1_Click()

PAISES(0) = "ARGENTINA"

PAISES(1) = "BRASIL"

PAISES(2) = "COLOMBIA"

PAISES(3) = "ECUADOR"

PAISES(4) = "CHILE"

PAISES(5) = "GUATEMALA"

PAISES(6) = "MÉXICO"

For X = 0 To 6

MsgBox "NOMBRE DEL PAIS:" & PAISES(X)


Next X

End Sub

PROGRAMA 18
Private Sub Command1_Click()

Dim VECTOR(1 To 10) As Integer

Dim MAYOR As Integer

Dim MENOR As Integer

For INDICE = 1 To 10

VECTOR(INDICE) = InputBox("NUMERO:" & INDICE)

Next

MAYOR = VECTOR(1)

For INDICE = 1 To 10

If VECTOR(INDICE) > MAYOR Then

MAYOR = VECTOR(INDICE)

End If

Next

MENOR = MAYOR

For INDICE = 1 To 10

If VECTOR(INDICE) < MENOR Then

MENOR = VECTOR(INDICE)

End If

Next

Label1.Caption = "MAYOR"

Label2.Caption = "MENOR"

Text1.Text = MAYOR

Text2.Text = MENOR

End Sub
PROGRAMA 19
Dim MENSAJE As String

Private Sub Command1_Click()

Adodc1.Recordset.MoveNext

If Adodc1.Recordset.EOF Then

Adodc1.Recordset.MoveLast

End If

End Sub

Private Sub Command2_Click()

Adodc1.Recordset.MovePrevious

If Adodc1.Recordset.BOF Then

Adodc1.Recordset.MoveFirst

End If

End Sub

Private Sub Command3_Click()

Adodc1.Recordset.AddNew

End Sub

Private Sub Command4_Click()

If Text1.Text = "" Or Text2.Text = "" Or Text3.Text = "" Or Text4.Text = "" Or Text5.Text = "" Then

MENSAJE = MsgBox("TE FALTAN DATOS", vbCritical, "LLENAR")

Else

Adodc1.Recordset.Update

End If

End Sub

Private Sub Command5_Click()

Adodc1.Recordset.Delete

Adodc1.Recordset.MoveNext

If Adodc1.Recordset.EOF Then

Adodc1.Recordset.MoveLast
End If

End Sub

Private Sub Command6_Click()

End

End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)

If KeyAscii <> 10 Then

If KeyAscii < 48 Or KeyAscii > 57 Then

KeyAscii = 0

End If

End If

End Sub

También podría gustarte