programas en visual basic

26
COLEGIO “HUMBERTO MATA MARTÍNEZ” PROGRAMACIÓN VISUAL BASIC NOMBRE: MARÍA JOSÉ QUINTANA CURSO: SEGUNDO TÉCNICO LICENCIADO: RODRIGO MULLO TEMA: REALIZACION DE PROGRAMAS AÑO LECTIVO 2013-2014

Upload: majo-quintana

Post on 22-Mar-2016

228 views

Category:

Documents


2 download

DESCRIPTION

realizados para demostrar conocimientos adquieridos tanto práctico como intelectual

TRANSCRIPT

COLEGIO “HUMBERTO MATA MARTÍNEZ”

PROGRAMACIÓN

VISUAL BASIC

NOMBRE: MARÍA JOSÉ QUINTANA

CURSO: SEGUNDO TÉCNICO

LICENCIADO: RODRIGO MULLO

TEMA: REALIZACION DE PROGRAMAS

AÑO LECTIVO

2013-2014

PROGRAMA N°1

Tema: crear una calculadora básica

Public Class Form1 Dim DATO As Double Dim DATO2 As Double Dim RESUL As Double Dim OPE As Double Dim PUN As Double Private Sub BT17_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BT17.Click TextBox1.Clear() BT2.Enabled = True End Sub Private Sub BT1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BT1.Click TextBox1.Text = TextBox1.Text & "0" End Sub Private Sub BT2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BT2.Click TextBox1.Text = TextBox1.Text & "." PUN = 1 If PUN = 1 Then BT2.Enabled = False End If End Sub Private Sub BT5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BT5.Click TextBox1.Text = TextBox1.Text & "1" End Sub Private Sub BT6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BT6.Click TextBox1.Text = TextBox1.Text & "2"

End Sub Private Sub BT7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BT7.Click TextBox1.Text = TextBox1.Text & "3" End Sub Private Sub BT9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BT9.Click TextBox1.Text = TextBox1.Text & "4" End Sub Private Sub BT10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BT10.Click TextBox1.Text = TextBox1.Text & "5" End Sub Private Sub BT11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BT11.Click TextBox1.Text = TextBox1.Text & "6" End Sub Private Sub BT13_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BT13.Click TextBox1.Text = TextBox1.Text & "7" End Sub Private Sub BT14_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BT14.Click TextBox1.Text = TextBox1.Text & "8" End Sub Private Sub BT15_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BT15.Click TextBox1.Text = TextBox1.Text & "9" End Sub Private Sub BT16_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BT16.Click OPE = 1 DATO = Val(TextBox1.Text) TextBox1.Clear() BT2.Enabled = True End Sub Private Sub BT3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BT3.Click DATO2 = Val(TextBox1.Text) If OPE = 1 Then RESUL = DATO + DATO2 TextBox1.Text = RESUL BT2.Enabled = True Else

If OPE = 2 Then RESUL = DATO - DATO2 TextBox1.Text = RESUL BT2.Enabled = True Else If OPE = 3 Then RESUL = DATO * DATO2 TextBox1.Text = RESUL BT2.Enabled = True Else If OPE = 4 Then RESUL = DATO / DATO2 TextBox1.Text = RESUL BT2.Enabled = True End If End If End If End If End Sub Private Sub BT12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BT12.Click OPE = 2 DATO = Val(TextBox1.Text) TextBox1.Clear() BT2.Enabled = True End Sub Private Sub BT8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BT8.Click OPE = 3 DATO = Val(TextBox1.Text) TextBox1.Clear() BT2.Enabled = True End Sub Private Sub BT4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BT4.Click OPE = 4 DATO = Val(TextBox1.Text) TextBox1.Clear() BT2.Enabled = True End Sub End Class

PROGRAMA N°2

TEMA: realizar un programa de

cálculo de operaciones básicas

Public Class Form1 Dim Text3 As Integer Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click TextBox3.Text = Val(TextBox2.Text) + Val(TextBox1.Text) End Sub Private Sub Button2_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click TextBox3.Text = Val(TextBox2.Text) - Val(TextBox1.Text) End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click TextBox3.Text = Val(TextBox2.Text) * Val(TextBox1.Text) End Sub Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click TextBox3.Text = Val(TextBox2.Text) / Val(TextBox1.Text) End Sub End Class

PROGRMA N°3

TEMA: programa de promedios y escala

de calificaciones

Public Class Form1 Dim n1 As Double Dim n2 As Double Dim n3 As Double Dim n4 As Double Dim resul As Double Dim pro As Double Dim div As Double Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged n1 = Val(TextBox1.Text) If n1 > 10 Then MsgBox("error nota mayor a 10") End If End Sub Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox2.TextChanged n2 = Val(TextBox2.Text) If n2 > 10 Then MsgBox("error nota mayor a 10") End If End Sub Private Sub TextBox3_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox3.TextChanged n3 = Val(TextBox3.Text) If n3 > 10 Then MsgBox("error nota mayor a 10") End If End Sub

Private Sub TextBox4_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox4.TextChanged n4 = Val(TextBox4.Text) If n4 > 10 Then MsgBox("error nota mayor a 10") End If End Sub Private Sub BT5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BT5.Click TextBox5.Text = TextBox5.Text TextBox5.Text = (n1 + n2 + n3 + n4) End Sub Private Sub BT6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BT6.Click div = 4 TextBox6.Text = (n1 + n2 + n3 + n4) / div resul = (n1 + n2 + n3 + n4) / div End Sub Private Sub BT7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BT7.Click If resul = 10 Then TextBox7.Text = " supera los aprendizajes requeridos" Else If resul >= 8 Then TextBox7.Text = "domina los aprendizajes requeridos " Else If resul = 7 Then TextBox7.Text = "alcansa los aprendizajes requeridos " Else If resul >= 5 Then TextBox7.Text = "proximo los aprendizajes requeridos " Else If resul <= 4 Then TextBox7.Text = "no alcansa los aprendizajes requeridos " End If End If End If End If End If End Sub End Class

PROGRAMA N°4

TEMA: transformación de moneda (de

dólar a euro)

Public Class Form1 Dim dl As Double Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click dl = Val(TextBox1.Text) TextBox2.Text = dl * 0.7829 End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click TextBox1.Clear() TextBox2.Clear() End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click End End Sub End Class

PROGRAMA N°5

TEMA: transformación de horas a

minutos y segundos

Public Class Form1 Dim CV Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click CV = Val(TextBox1.Text) TextBox2.Text = CV * 60 TextBox3.Text = CV * 1300 End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click TextBox1.Clear() TextBox2.Clear() TextBox3.Clear() End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click End End Sub End Class

PROGRAMA N°6

TEMA: transformar días a

horas, minutos y segundos

Public Class Form1 Dim CV As Double Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click CV = Val(TextBox1.Text) TextBox2.Text = CV * 24 TextBox3.Text = CV * 1440 TextBox4.Text = CV * 86400 End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click TextBox1.Clear() TextBox2.Clear() TextBox3.Clear() TextBox4.Clear() End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click End End Sub End Class

PROGRMA N° 7

TEMA: transformación monetaria

(diez monedas diferentes)

Public Class Form1 Dim dl As Double Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click dl = Val(TextBox10.Text) TextBox1.Text = dl * 12.4341 TextBox2.Text = dl * 95.4315 TextBox3.Text = dl * 9.19181 TextBox4.Text = dl * 1.49826 TextBox5.Text = dl * 79.0 TextBox6.Text = dl * 5.088 TextBox7.Text = dl * 0.960728 TextBox8.Text = dl * 6.90964 TextBox9.Text = dl * 6.78615 End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click TextBox1.Clear() TextBox2.Clear() TextBox3.Clear() TextBox4.Clear() TextBox5.Clear() TextBox6.Clear() TextBox7.Clear() TextBox8.Clear() TextBox9.Clear() TextBox10.Clear() End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click

End End Sub

PROGRAMA N°8

TEMA: calcular el área del triángulo

rectángulo

Public Class Form1 Dim B As Double Dim A As Double Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click B = Val(TextBox1.Text) A = Val(TextBox2.Text) TextBox3.Text = (A * B) / 2 End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click TextBox1.Clear() TextBox2.Clear() TextBox3.Clear() End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click End End Sub End Class

PROGRAMA N° 9

TEMA: calcular el área y perímetro del

triángulo rectángulo

Public Class Form1 Dim B As Double Dim A As Double Dim l1 As Double Dim l2 As Double Dim l3 As Double Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click B = Val(TextBox1.Text) A = Val(TextBox2.Text) l1 = Val(TextBox3.Text) l2 = Val(TextBox4.Text) l3 = Val(TextBox5.Text) TextBox6.Text = (B * A) / 2 TextBox7.Text = l1 + l2 + l3 End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click TextBox1.Clear() TextBox2.Clear() TextBox3.Clear() TextBox4.Clear() TextBox5.Clear() TextBox6.Clear() TextBox7.Clear() End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click End End Sub End Class

PROGRAMA N°10

TEMA: calcular el área de la

circunferencia

Public Class Form1 Dim PI As Double Dim Rd As Double Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click PI = 3.1415 Rd = Val(TextBox1.Text) TextBox2.Text = PI * (Rd * Rd) TextBox3.Text = 2 * (PI * Rd) End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click TextBox1.Clear() TextBox2.Clear() TextBox3.Clear() End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click End End Sub End Class

PROGRAMA N° 11

TEMA: área y perímetro del

cuadrado

Public Class Form1

Dim L1 As Double Dim L2 As Double Dim L3 As Double Dim L4 As Double Dim B As Double Dim A As Double Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click L1 = Val(TextBox1.Text) L2 = Val(TextBox2.Text) L3 = Val(TextBox3.Text) L4 = Val(TextBox4.Text) TextBox5.Text = L1 + L2 + L3 + L4 B = Val(TextBox7.Text) A = Val(TextBox8.Text) TextBox6.Text = B * A End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click TextBox1.Text = "" TextBox2.Text = "" TextBox3.Text = "" TextBox4.Text = "" TextBox5.Text = "" TextBox6.Text = "" TextBox7.Text = "" TextBox8.Text = "" End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click End End Sub End Class

PROGRAMA N° 12

TEMA: calcular área y perímetro del

rombo

ublic Class Form1 Dim DM As Double Dim Ds As Double Dim l1 As Double Dim l2 As Double Dim l3 As Double Dim l4 As Double Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click DM = Val(TextBox1.Text) Ds = Val(TextBox2.Text) l1 = Val(TextBox3.Text) l2 = Val(TextBox4.Text) l3 = Val(TextBox5.Text) l4 = Val(TextBox6.Text) TextBox7.Text = (DM * Ds) / 2 TextBox8.Text = l1 + l2 + l3 + l4 End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click TextBox1.Clear() TextBox2.Clear() TextBox3.Clear() TextBox4.Clear() TextBox5.Clear() TextBox6.Clear() TextBox7.Clear() TextBox8.Clear() End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click End End Sub End Class

PROGRAMA N° 13

TEMA: calcular el área y

perímetro del rectángulo

Public Class Form1 Dim L1 As Double Dim L2 As Double Dim L3 As Double Dim L4 As Double Dim B As Double Dim A As Double Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click L1 = Val(TextBox1.Text) L2 = Val(TextBox2.Text) L3 = Val(TextBox3.Text) L4 = Val(TextBox4.Text) TextBox5.Text = L1 + L2 + L3 + L4 B = Val(TextBox7.Text) A = Val(TextBox8.Text) TextBox6.Text = B * A End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click TextBox1.Text = "" TextBox2.Text = "" TextBox3.Text = "" TextBox4.Text = "" TextBox5.Text = "" TextBox6.Text = "" TextBox7.Text = "" TextBox8.Text = "" End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click End End Sub End Class

PROGRAMA N°14 TEMA: realizar programa

factura

Public Class Form1 Dim CT As Double Dim CT1 As Double Dim CT2 As Double Dim CT3 As Double Dim CT4 As Double Dim VU As Double Dim VU1 As Double Dim VU2 As Double Dim VU3 As Double Dim VU4 As Double Dim Vt As Double Dim Vt1 As Double Dim Vt2 As Double Dim Vt3 As Double Dim Vt4 As Double Dim R As Double Dim v2 As Double Dim v3 As Double Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click CT = Val(TextBox1.Text) CT1 = Val(TextBox2.Text) CT2 = Val(TextBox3.Text) CT3 = Val(TextBox4.Text) CT4 = Val(TextBox5.Text) VU = Val(TextBox11.Text) VU1 = Val(TextBox12.Text) VU2 = Val(TextBox13.Text) VU3 = Val(TextBox14.Text)

VU4 = Val(TextBox15.Text) TextBox16.Text = CT * VU TextBox17.Text = CT1 * VU1 TextBox18.Text = CT2 * VU2 TextBox19.Text = CT3 * VU3 TextBox20.Text = CT4 * VU4 Vt = Val(TextBox16.Text) Vt1 = Val(TextBox17.Text) Vt2 = Val(TextBox18.Text) Vt3 = Val(TextBox19.Text) Vt4 = Val(TextBox20.Text) TextBox21.Text = Vt + Vt1 + Vt3 + Vt4 If (TextBox21.Text > 10000) Then TextBox22.Text = (TextBox21.Text * 100) / 25 MsgBox("DESCUENTO DE 25%") Else If (TextBox21.Text > 5000 & TextBox21.Text < 10000) Then TextBox22.Text = (TextBox21.Text * 100) / 20 MsgBox("DESCUENTO DE 20%") Else If (TextBox21.Text >= 2500 & TextBox21.Text < 5000) Then TextBox22.Text = (TextBox21.Text * 100) / 15 MsgBox("DESCUENTO DE 15%") Else If (TextBox21.Text >= 1200 & TextBox21.Text < 2500) Then TextBox22.Text = (TextBox21.Text * 100) / 10 MsgBox("DESCUENTO DE 10%") Else If (TextBox21.Text >= 350 & TextBox21.Text < 1200) Then TextBox22.Text = (TextBox21.Text * 100) / 5 MsgBox("DESCUENTO DE 5%") Else If (TextBox21.Text < 350) Then TextBox22.Text = 0.0 MsgBox("NO EXISTE DESCUENTO") End If End If End If End If End If End If TextBox23.Text = TextBox21.Text - TextBox22.Text R = TextBox21.Text * 0.1 v2 = Val(TextBox22.Text) v3 = Val(TextBox24.Text)

TextBox24.Text = TextBox21.Text - R TextBox25.Text = (TextBox21.Text - v2) + v3 End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click TextBox1.Clear() TextBox2.Clear() TextBox3.Clear() TextBox4.Clear() TextBox5.Clear() TextBox6.Clear() TextBox7.Clear() TextBox8.Clear() TextBox9.Clear() TextBox10.Clear() TextBox11.Clear() TextBox12.Clear() TextBox13.Clear() TextBox14.Clear() TextBox15.Clear() TextBox16.Clear() TextBox17.Clear() TextBox18.Clear() TextBox19.Clear() TextBox20.Clear() TextBox21.Clear() TextBox22.Clear() TextBox23.Clear() TextBox24.Clear() TextBox25.Clear() End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click End End Sub End Class

PROGRMA N°15

TEMA: calcular

área, volumen y

perímetro de

varias figuras

ublic Class Form1 Dim a As Double Dim h As Double Dim base As Double Dim rd As Double Dim pi As Double Dim Bs As Double Dim H2 As Double Dim l1 As Double Dim l2 As Double Dim l3 As Double Dim cb As Double Dim ld As Double Dim ld2 As Double Dim ld3 As Double Dim rd2 As Double Dim h3 As Double Dim hp As Double Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click a = Val(TextBox1.Text) TextBox2.Text = a * a TextBox3.Text = a + a + a + a End Sub Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click

h = Val(TextBox5.Text) base = Val(TextBox4.Text) TextBox6.Text = base * h TextBox7.Text = (2 * base) + (2 * h) End Sub Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click rd = TextBox8.Text pi = 3.1415 TextBox9.Text = pi * (rd * rd) TextBox10.Text = 2 * rd * pi End Sub Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click Bs = Val(TextBox11.Text) H2 = Val(TextBox12.Text) l1 = TextBox13.Text l2 = TextBox14.Text hp = Math.Sqrt(l1 ^ 2 + l2 ^ 2) TextBox15.Text = (Bs * H2) / 2 TextBox16.Text = l1 + l2 + hp End Sub Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click cb = Val(TextBox17.Text) TextBox18.Text = 6 * (cb ^ 2) TextBox19.Text = cb ^ 3 End Sub Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click ld = Val(TextBox20.Text) ld2 = Val(TextBox21.Text) ld3 = Val(TextBox22.Text) TextBox23.Text = 2 * (ld * ld2) + 2 * (ld2 * ld3) + 2 * (ld * ld3) TextBox24.Text = ld * ld2 * ld3 End Sub Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click h3 = TextBox30.Text rd2 = TextBox25.Text pi = 3.1415 TextBox27.Text = 2 * pi * (rd2 * rd2) TextBox28.Text = 2 * pi * rd2 * h3 TextBox26.Text = 2 * rd2 * pi TextBox29.Text = pi * (rd2 * rd2) * h3 End Sub End Class

PROGRMA N° 16 TEMA: identificar si el numero ingresado es positive o negativo

Public Class Form1 Dim residuo As Double Dim i As Double Dim r As Double Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click r = Val(TextBox1.Text) residuo = r Mod 2 If residuo = 1 Then TextBox2.Text = (r & " ES IMPAR ") Else TextBox2.Text = (r & " ES PAR ") End If End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click TextBox1.Clear() TextBox2.Clear() End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click End End Sub End Class

PROGRAMA N° 17

TEMA: identificar si el numero

ingresado es positive o negativo

Public Class Form1 Dim R As Double Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click R = Val(TextBox1.Text) If (R > 0) Then TextBox2.Text = "POSITIVO" End If If (R < 0) Then TextBox2.Text = "NEGATIVO" End If End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click TextBox1.Clear() TextBox2.Clear() End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click End End Sub End Class

PROGRAMA N°18

TEMA: realizar un programa de las

tablas de multiplicar

Public Class Form1 Dim TB As Double Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click TB = Val(TextBox37.Text) TextBox13.Text = TB TextBox14.Text = TB TextBox15.Text = TB TextBox16.Text = TB TextBox17.Text = TB TextBox18.Text = TB TextBox19.Text = TB TextBox20.Text = TB TextBox21.Text = TB TextBox22.Text = TB TextBox23.Text = TB TextBox24.Text = TB TextBox25.Text = TB * TextBox1.Text TextBox26.Text = TB * TextBox2.Text TextBox27.Text = TB * TextBox3.Text TextBox28.Text = TB * TextBox4.Text TextBox29.Text = TB * TextBox5.Text TextBox30.Text = TB * TextBox6.Text TextBox31.Text = TB * TextBox7.Text TextBox32.Text = TB * TextBox8.Text TextBox33.Text = TB * TextBox9.Text TextBox34.Text = TB * TextBox10.Text TextBox35.Text = TB * TextBox11.Text TextBox36.Text = TB * TextBox12.Text

End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click TextBox13.Clear() TextBox14.Clear() TextBox15.Clear() TextBox16.Clear() TextBox17.Clear() TextBox18.Clear() TextBox19.Clear() TextBox20.Clear() TextBox21.Clear() TextBox22.Clear() TextBox23.Clear() TextBox24.Clear() TextBox25.Clear() TextBox26.Clear() TextBox27.Clear() TextBox28.Clear() TextBox29.Clear() TextBox30.Clear() TextBox31.Clear() TextBox32.Clear() TextBox33.Clear() TextBox34.Clear() TextBox35.Clear() TextBox37.Clear() TextBox36.Clear() End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click End End Sub End Class