UNIVERSIDAD CENTRAL DEL ECUADOR
FACULTAD DE FILOSOFÍA, LETRAS Y CIENCIAS DE LA EDUCACIÓN
ESCUELA CIENCIAS EXACTAS CARRERA: INFORMÁTICA CUARTO SEMESTRE
PROGRAMACIÓN IV NOMBRE: Lizeth Tapia RECOPILACIÓN DE PROGRAMAS
QUITO D.M, 19 DE AGOSTO DEL 2014
PROGRAMA PARA UNIR CARACTERES
Public Class Form2 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim texto1, texto2 As String texto1 = TextBox1.Text texto2 = TextBox2.Text TextBox3.Text = texto1 + texto2 End Sub Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click TextBox1.Text = "" TextBox2.Text = "" TextBox3.Text = "" End Sub Private Sub Button3_Click(sender As System.Object, e As System.EventArgs) Handles Button3.Click Me.Close() End Sub End Class
PROGRAMA MSGBOX
Public Class Form3 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim A As Integer Dim RES As Boolean A = TextBox1.Text RES = Not (A + 10 < 20) MsgBox(RES) End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Me.Close() End Sub Private Sub TextBox1_TextChanged(sender As System.Object, e As System.EventArgs) Handles TextBox1.TextChanged End Sub End Class
PROGRAMA ENLACE FORMULARIOS
Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim num1, num2 As Integer num1 = TextBox1.Text num2 = TextBox2.Text TextBox3.Text = num1 + num2 End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Me.Close() End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click form2.show() Me.Hide() End Sub Private Sub Button4_Click(sender As System.Object, e As System.EventArgs) Handles Button4.Click TextBox1.Text = "" TextBox2.Text = "" TextBox3.Text = "" End Sub End Class
PROGRAMA DISEテ前 FORMULARIOS
Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Me.BackColor = Color.Chocolate End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Me.Text = "Primer formulario" Me.ForeColor = Color.DarkGreen End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Me.Close() End Sub End Class
PROGRAMA VISUALIZAR IMAGEN
Public Class Form3 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click imagen1.Visible = True End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click imagen1.Visible = False End Sub End Class
PROGRAMA EVENTOS FORMULARIO
Public Class Form2 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Label1.Text = "Mi segundo formulario" End Sub Private Sub Button2_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Button2.MouseMove Me.BackColor = Color.HotPink End Sub Private Sub Button3_Click(sender As System.Object, e As System.EventArgs) Handles Button3.Click Label1.ForeColor = Color.GreenYellow End Sub End Class
PROGRAMA CON LISTBOX
Public Class Form6 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click ListBox1.Items.Add(TextBox1.Text) TextBox1.Text = "" TextBox1.Focus() End Sub Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click TextBox1.Text = "" End Sub Private Sub Button3_Click(sender As System.Object, e As System.EventArgs) Handles Button3.Click Me.Close() End Sub End Class
PROGRAMA CON CHECKBOX
Public Class Form7 Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged TextBox1.Text = "PROGRAMACIÓN" End Sub Private Sub CheckBox2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox2.CheckedChanged TextBox1.Text = "INFORMÁTICA" End Sub End Class
PROGRAMA OPERACIONES BĂ SICAS
Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click N3.Text = Val(N1.Text) + Val(N2.Text) End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click N3.Text = Val(N1.Text) - Val(N2.Text) End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click N3.Text = Val(N1.Text) * Val(N2.Text) End Sub Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click N3.Text = Val(N1.Text) / Val(N2.Text) End Sub Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click N3.Text = Val(N1.Text) \ Val(N2.Text) End Sub Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click N3.Text = Val(N1.Text) ^ Val(N2.Text) End Sub Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click N3.Text = Val(N1.Text) Mod Val(N2.Text) End Sub Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button10.Click N1.Text = "" N2.Text = "" N3.Text = "" N1.Focus() End Sub Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click Me.Close() End Sub Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click Me.Hide() Form2.Show() End Sub End Class
PROGRAMA OPERACIONES BĂ SICAS/LISTBOX
Public Class Form9 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click num3.Text = Val(num1.Text) + Val(num2.Text) ListBox1.Items.Add(num3.Text) num3.Text = Val(num1.Text) - Val(num2.Text) ListBox1.Items.Add(num3.Text) num3.Text = Val(num1.Text) * Val(num2.Text) ListBox1.Items.Add(num3.Text) num3.Text = Val(num1.Text) / Val(num2.Text) ListBox1.Items.Add(num3.Text) End Sub Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click num1.Text = "" num2.Text = "" num3.Text = "" num1.Focus() End Sub End Class
PROGRAMA FECHA/HORA DEL SISTEMA
Public Class Form4 Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick TextBox1.Text = Date.Now TextBox2.Text = TimeOfDay End Sub End Class
PROGRAMA FACTURA
Public Class Form3 Private Sub salario_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles salario.Click Dim C, V, VT, I, T C = Val(CANT.Text) V = Val(VUNI.Text) VT = C * V I = VT * 0.12 T = VT + I ListBox1.Items.Add(PROD.Text) VTOTAL.Text = VT IVA.Text = I TOTAL.Text = T End Sub Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button10.Click ListBox1.Items.Clear() VTOTAL.Text = "" IVA.Text = "" TOTAL.Text = "" CANT.Text = "" VUNI.Text = "" PROD.Text = "" PROD.Focus() End Sub Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click Form1.Close() End Sub Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click Form4.Show() Me.Hide() End Sub End Class
PROGRAMA VALIDACIÓN FECHA
Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim A As Integer Dim M As Integer Dim D As Integer Dim d1 As Integer Dim bisiesto As Integer A = Mid(TextBox1.Text, 1, 4) M = Mid(TextBox1.Text, 6, 2) d1 = Mid(TextBox1.Text, 9, 2) bisiesto = A Mod (4) If A < 1900 Or A > 2014 Then MsgBox("Ingrese un año entre 1900 y 2014") TextBox1.Text = "" Else If M <= 0 Or M > 12 Then MsgBox("Ingrese otro mes") TextBox1.Text = "" Else Select Case M Case 1, 3, 5, 7, 8, 10, 12 D = 31 Case 4, 6, 9, 11 D = 31 Case 2 If bisiesto = 0 Then D = 29 Else D = 28 End If End Select If d1 > D Then MsgBox("Ingrese otro dia") TextBox1.Text = "" Else MsgBox("Fecha Existente") TextBox1.Text = "" End If End If End If End Sub End Class
PROGRAMA CON EVENTO MOUSEMOVE
Public Class Form4 Private Sub PictureBox1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseMove RESP.Text = "MONITOR" End Sub Private Sub PictureBox2_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox2.MouseMove RESP.Text = "TECLADO" End Sub Private Sub PictureBox3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox3.Click End Sub Private Sub PictureBox3_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox3.MouseMove RESP.Text = "RATĂ&#x201C;N" End Sub Private Sub PictureBox4_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox4.MouseMove RESP.Text = "CPU" End Sub Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button10.Click RESP.Text = "" End Sub Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click Me.Close() End Sub Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click Form5.Show() Me.Hide() End Sub End Class
PROGRAMA VALORES ALEATORIOS
Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As Dim num1, num2 As Integer num1 = Int((Rnd()) * 10) num2 = Int((Rnd()) * 10) TextBox1.Text = num1 TextBox2.Text = num2 PictureBox1.Image = Nothing TextBox3.Text = "" TextBox3.Focus() End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As If Val(TextBox3.Text) = Val(TextBox1.Text) + Val(TextBox2.Text) PictureBox1.Image = feliz.Image Else PictureBox1.Image = triste.Image End If End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As Me.Close() End Sub End Class
System.EventArgs) Handles Button1.Click
System.EventArgs) Handles Button2.Click Then
System.EventArgs) Handles Button3.Click
PROGRAMA VALIDACIÓN DE CONTRASEÑA
Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If TextBox1.Text = "Lizeth" And TextBox2.Text = "1234" Then Form2.Show() Else MsgBox("Contraseña Y/O usuario incorrecta") TextBox1.Text = "" TextBox2.Text = "" End If End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Me.Close() End Sub End Class
PROGRAMA CON OPCIONES DE MENÚS
1.
Para insertar menú de opciones se debe seleccionar el objeto MenuStrip y a continuación arrastrarlo hasta la parte superior izquierda del formulario. Finalmente se escribe los menús y submenús que se desee visualizar.
PROGRAMA CREANDO UNA WEB
Public Class Form1 Private Sub Button3_Click(ByVal sender As Button3.Click WebBrowser1.Navigate(TextBox1.Text) End Sub Private Sub Button4_Click(ByVal sender As Button4.Click WebBrowser1.Refresh() End Sub Private Sub Button2_Click(ByVal sender As Button2.Click WebBrowser1.GoBack() End Sub Private Sub Button1_Click(ByVal sender As Button1.Click WebBrowser1.GoForward() End Sub End Class
System.Object, ByVal e As System.EventArgs) Handles
System.Object, ByVal e As System.EventArgs) Handles
System.Object, ByVal e As System.EventArgs) Handles
System.Object, ByVal e As System.EventArgs) Handles
PROGRAMA ADIVINANZAS
Public Class Form2 Private Sub Button1_Click(ByVal sender As System.Object, ByVal feliz1.Visible = True End Sub Private Sub Button8_Click(ByVal sender As System.Object, ByVal feliz2.Visible = True End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal triste1.Visible = True End Sub Private Sub Button6_Click(ByVal sender As System.Object, ByVal triste2.Visible = True End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal rosa1.Visible = True End Sub Private Sub Button4_Click(ByVal sender As System.Object, ByVal rosa2.Visible = True End Sub Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e If feliz1.Visible = True And feliz2.Visible = True Then feliz1.Visible = True Else feliz1.Visible = False End If End Sub Private Sub Timer8_Tick(ByVal sender As System.Object, ByVal e If feliz2.Visible = True And feliz1.Visible = True Then feliz2.Visible = True Else feliz2.Visible = False End If End Sub Private Sub Button5_Click(ByVal sender As System.Object, ByVal love1.Visible = True End Sub Private Sub Button7_Click(ByVal sender As System.Object, ByVal love2.Visible = True End Sub Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e If rosa1.Visible = True And rosa2.Visible = True Then rosa1.Visible = True Else rosa1.Visible = False End If End Sub Private Sub Timer4_Tick(ByVal sender As System.Object, ByVal e If rosa2.Visible = True And rosa1.Visible = True Then rosa2.Visible = True Else rosa2.Visible = False End If End Sub Private Sub Timer3_Tick(ByVal sender As System.Object, ByVal e If triste1.Visible = True And triste2.Visible = True Then triste1.Visible = True Else triste1.Visible = False End If End Sub Private Sub Timer6_Tick(ByVal sender As System.Object, ByVal e If triste2.Visible = True And feliz1.Visible = True Then triste2.Visible = True Else triste2.Visible = False End If End Sub Private Sub Timer5_Tick(ByVal sender As System.Object, ByVal e If love1.Visible = True And love2.Visible = True Then love1.Visible = True Else love1.Visible = False End If End Sub Private Sub Timer7_Tick(ByVal sender As System.Object, ByVal e If love2.Visible = True And love1.Visible = True Then
e As System.EventArgs) Handles Button1.Click e As System.EventArgs) Handles Button8.Click e As System.EventArgs) Handles Button3.Click
e As System.EventArgs) Handles Button6.Click e As System.EventArgs) Handles Button2.Click e As System.EventArgs) Handles Button4.Click As System.EventArgs) Handles Timer1.Tick
As System.EventArgs) Handles Timer8.Tick
e As System.EventArgs) Handles Button5.Click e As System.EventArgs) Handles Button7.Click As System.EventArgs) Handles Timer2.Tick
As System.EventArgs) Handles Timer4.Tick
As System.EventArgs) Handles Timer3.Tick
As System.EventArgs) Handles Timer6.Tick
As System.EventArgs) Handles Timer5.Tick
As System.EventArgs) Handles Timer7.Tick
love2.Visible = True Else love2.Visible = False End If End Sub Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click feliz1.Visible = False feliz2.Visible = False triste1.Visible = False triste2.Visible = False rosa1.Visible = False rosa2.Visible = False love1.Visible = False love2.Visible = False End Sub End Class
PROGRAMA CARTAS MĂ GICAS
Public Class Form2 Private Sub Button2_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Dim A, B, C, D, H, F, R As Integer If CheckBox1.Checked = True Then A = 8 Else A = 0 End If If CheckBox2.Checked = True Then B = 32 Else B = 0 End If If CheckBox3.Checked = True Then C = 1 Else C = 0 End If If CheckBox4.Checked = True Then D = 16 Else D = 0 End If If CheckBox5.Checked = True Then H = 2 Else H = 0 End If If CheckBox6.Checked = True Then F = 4 Else
F = 0 End If R = A + B + C + D + H + F TextBox1.Text = R End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Me.Close() End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click CheckBox1.Checked = False CheckBox2.Checked = False CheckBox3.Checked = False CheckBox4.Checked = False CheckBox5.Checked = False CheckBox6.Checked = False TextBox1.Text = "" End Sub End Class
PROGRAMA CON PROGRESSBAR
Public Class Form2 Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim Usuario As String Dim contrase単a As String Usuario = "Lizeth" contrase単a = "123" If TextBox1.Text = Usuario And TextBox2.Text = contrase単a Then Timer1.Start() Else MsgBox("El nombre de usuario o contrase単a es incorrecto.") TextBox1.Text = "" TextBox2.Text = "" End If End Sub Private Sub Timer1_Tick_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick ProgressBar1.Increment(5) If ProgressBar1.Value = 100 Then Form1.Show() End If End Sub End Class
PROGRAMA CON FUNCIÓN MID
Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click TextBox2.Text = Mid(TextBox1.Text, 2, 2) End Sub End Class
PROGRAMA CON ANIMACIÓN
Public Class Form1 Dim cont As Integer = 0 Dim UNIVERSIDAD As String Dim CENTRAL As String Dim DELECUADOR As String Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Timer1.Start() End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ACEPTAR.Click Dim Usuario As String Dim contraseña As String Usuario = "Lizeth" contraseña = "1234" If TextBox1.Text = Usuario And TextBox2.Text = contraseña Then Timer2.Start() Else MsgBox("Usuario y/o contraseña incorrecto") TextBox1.Text = "" TextBox2.Text = "" End If End Sub Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick ProgressBar1.Increment(5) If ProgressBar1.Value = 100 Then Form2.Show() Me.Hide() End If End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Me.Close() End Sub Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
If cont = 3 Then cont = 0 Else cont = cont + 1 Select Case cont Case 1 Label1.Visible Label3.Visible Label4.Visible Case 2 Label1.Visible Label3.Visible Label4.Visible Case 3 Label1.Visible Label3.Visible Label4.Visible End Select End If End Sub End Class
= True = False = False = False = True = False = False = False = True
PROGRAMA CON FUNCIÓN LEN
Public Class Form2 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click TextBox2.Text = Len(TextBox1.Text) End Sub End Class
PROGRAMA JORNADAS DEL DÍA
Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim H As Integer H = TextBox1.Text
Select Case H Case 1 To 5 MsgBox("MADRUGADA") Case 6 To 11 MsgBox("MAÑANA") Case 12 To 18 MsgBox("TARDE") Case 19 To 24 MsgBox("NOCHE") End Select End Sub Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click Me.Close() End Sub End Class
PROGRAMA AÑO BISIESTO
Public Class Form2 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim A As Integer Dim M As Integer Dim D As Integer A = Mid(TextBox1.Text, 1, 4) M = Mid(TextBox1.Text, 6, 2) D = Mid(TextBox1.Text, 9, 2) If A <= 1990 Or A >= 2014 Then MsgBox("ERROR") Else Select Case A Case A * 4 MsgBox("AÑO BISIESTO") End Select Select Case M Case 1, 3, 5, 7, 8, 10, 12 = 31 And 2, 4, 6, 9, 11 = 30 MsgBox("CORRECTO") End Select End If End Sub Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click Me.Close() End Sub End Class
PROGRAMA AGENDA PERSONAL
Imports System.IO Imports System Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim N As String Dim A As String Dim D As String Dim C As String N = txtNombre.Text A = txtApellido.Text D = txtDireccion.Text C = ComboBox1.Text Dim DATOS As New System.IO.StreamWriter("C:\Users\lab_infor_22\Desktop\Agenda_Lizeth Tapia.txt", True) If ListBox1.FindString("Nombre: " + N + " " + "Apellido:" + A) <> -1 Then MessageBox.Show("Registro existente") Else ListBox1.Items.Add("Nombre: " + N + " " + "Apellido:" + A + " " + "Direcci贸n:" + D + " " + "Estado Civil:" + C) End If DATOS.WriteLine("AGENDA") DATOS.WriteLine("Nombre: " + N + " " + "Apellido:" + A + " " + "Direcci贸n:" + D + " " + "Estado Civil:" + C) DATOS.Close() End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click txtNombre.Clear() txtApellido.Clear() txtDireccion.Clear() ComboBox1.Text = "" txtNombre.Focus() End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click txtNombre.Clear() txtApellido.Clear() txtDireccion.Clear() ComboBox1.Text = "" txtNombre.Focus() End Sub Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click Me.Close() End Sub End Class
PROGRAMA VALIDACIÓN CÉDULA
Public Class Form1 Public contador As Integer Public u, v, x, y, z, u2, v2, x2, y2, z2, uc, vc, xc, yc, zc, impares As Integer Public o, p, q, r, pares As Integer Public suma, prueba, respuesta, ultimo As Integer Public provincia As String Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click u = Mid(TextBox1.Text, 1, 1) u2 = u * 2 If u2 >= 9 Then uc = u2 - 9 Else uc = u2 End If v = Mid(TextBox1.Text, 3, 1) v2 = v * 2 If v2 >= 9 Then vc = v2 - 9 Else vc = v2 End If x = Mid(TextBox1.Text, 5, 1) x2 = x * 2 If x2 >= 9 Then xc = x2 - 9 Else xc = x2 End If y = Mid(TextBox1.Text, 7, 1) y2 = y * 2 If y2 >= 9 Then yc = y2 - 9 Else yc = v2 End If z = Mid(TextBox1.Text, 9, 1) z2 = z * 2 If z2 >= 9 Then zc = z2 - 9 Else zc = z2 End If impares = uc + vc + xc + yc + zc 'PARES o = Mid(TextBox1.Text, 2, 1) p = Mid(TextBox1.Text, 4, 1) q = Mid(TextBox1.Text, 6, 1) r = Mid(TextBox1.Text, 8, 1) pares = o + p + q + r suma = pares + impares prueba = (Mid(suma, 1, 1) + 1) * 10 respuesta = prueba - suma ultimo = Mid(TextBox1.Text, 10, 1) provincia = Mid(TextBox1.Text, 1, 2) If Val(provincia) > 24 Then MsgBox("Cédula errónea", MsgBoxStyle.Critical) Else If respuesta = ultimo And provincia = "01" Then MsgBox("Cédula validada, Provincia: Azuay", MsgBoxStyle.Information) ElseIf respuesta = ultimo And provincia = "02" Then MsgBox("Cédula validada, Provincia: Bolivar", MsgBoxStyle.Information) ElseIf respuesta = ultimo And provincia = "03" Then MsgBox("Cédula validada, Provincia: Cañar", MsgBoxStyle.Information)
ElseIf respuesta = MsgBox("Cédula ElseIf respuesta = MsgBox("Cédula ElseIf respuesta = MsgBox("Cédula ElseIf respuesta = MsgBox("Cédula ElseIf respuesta = MsgBox("Cédula ElseIf respuesta = MsgBox("Cédula ElseIf respuesta = MsgBox("Cédula ElseIf respuesta = MsgBox("Cédula ElseIf respuesta = MsgBox("Cédula ElseIf respuesta = MsgBox("Cédula ElseIf respuesta = MsgBox("Cédula ElseIf respuesta = MsgBox("Cédula ElseIf respuesta = MsgBox("Cédula ElseIf respuesta = MsgBox("Cédula ElseIf respuesta = MsgBox("Cédula ElseIf respuesta = MsgBox("Cédula ElseIf respuesta = MsgBox("Cédula ElseIf respuesta = MsgBox("Cédula ElseIf respuesta = MsgBox("Cédula ElseIf respuesta = MsgBox("Cédula ElseIf respuesta = MsgBox("Cédula Else MsgBox("Cédula End If End If TextBox1.Text = "" End Sub End Class
ultimo And provincia validada, Provincia: ultimo And provincia validada, Provincia: ultimo And provincia validada, Provincia: ultimo And provincia validada, Provincia: ultimo And provincia validada, Provincia: ultimo And provincia validada, Provincia: ultimo And provincia validada, Provincia: ultimo And provincia validada, Provincia: ultimo And provincia validada, Provincia: ultimo And provincia validada, Provincia: ultimo And provincia validada, Provincia: ultimo And provincia validada, Provincia: ultimo And provincia validada, Provincia: ultimo And provincia validada, Provincia: ultimo And provincia validada, Provincia: ultimo And provincia validada, Provincia: ultimo And provincia validada, Provincia: ultimo And provincia validada, Provincia: ultimo And provincia validada, Provincia: ultimo And provincia validada, Provincia: ultimo And provincia validada, Provincia:
= "04" Then Carchi", MsgBoxStyle.Information) = "05" Then Cotopaxi", MsgBoxStyle.Information) = "06" Then Chimborazo", MsgBoxStyle.Information) = "07" Then El Oro", MsgBoxStyle.Information) = "08" Then Esmeraldas", MsgBoxStyle.Information) = "09" Then Guayas", MsgBoxStyle.Information) = "10" Then Imbabura", MsgBoxStyle.Information) = "11" Then Loja", MsgBoxStyle.Information) = "12" Then Los Ríos", MsgBoxStyle.Information) = "13" Then Manabí", MsgBoxStyle.Information) = "14" Then Morona", MsgBoxStyle.Information) = "15" Then Napo", MsgBoxStyle.Information) = "16" Then Pastaza", MsgBoxStyle.Information) = "17" Then Pichincha", MsgBoxStyle.Information) = "18" Then Tungurahua", MsgBoxStyle.Information) = "19" Then Zamora", MsgBoxStyle.Information) = "20" Then Galapagos", MsgBoxStyle.Information) = "21" Then Sucumbios", MsgBoxStyle.Information) = "22" Then Orellana", MsgBoxStyle.Information) = "23" Then Sto. Domingo", MsgBoxStyle.Information) = "24" Then Sta. Elena", MsgBoxStyle.Information)
errónea", MsgBoxStyle.Critical)
PROGRAMA CONTEO VOCALES
Public Class Form1 Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Me.Close() 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 = "" End Sub Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton1.CheckedChanged Dim FRASE As Integer Dim EXTRAER As String Dim CONTAR As Integer = 0 FRASE = Len(TextBox1.Text) TextBox2.Text = FRASE For N = 1 To FRASE Step 1 EXTRAER = Mid(TextBox1.Text, 1, 1) If EXTRAER = "a" Or EXTRAER = "A" Then CONTAR = CONTAR + 1 End If TextBox4.Text = CONTAR Next End Sub Private Sub RadioButton2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton2.CheckedChanged Dim FRASE As Integer Dim EXTRAER As String Dim CONTAR As Integer = 0 FRASE = Len(TextBox1.Text) TextBox2.Text = FRASE For i = 1 To FRASE Step 1 EXTRAER = Mid(TextBox1.Text, i, 1) TextBox3.Text = EXTRAER If EXTRAER = "e" Or EXTRAER = "E" Then CONTAR = CONTAR + 1 End If TextBox4.Text = CONTAR Next End Sub Private Sub RadioButton3_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton3.CheckedChanged Dim FRASE As Integer Dim EXTRAER As String Dim CONTAR As Integer = 0 FRASE = Len(TextBox1.Text) TextBox2.Text = FRASE For i = 1 To FRASE Step 1 EXTRAER = Mid(TextBox1.Text, i, 1) TextBox3.Text = EXTRAER If EXTRAER = "i" Or EXTRAER = "I" Then CONTAR = CONTAR + 1 End If TextBox4.Text = CONTAR Next End Sub Private Sub RadioButton4_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton4.CheckedChanged Dim FRASE As Integer Dim EXTRAER As String Dim CONTAR As Integer = 0 FRASE = Len(TextBox1.Text) TextBox2.Text = FRASE For i = 1 To FRASE Step 1 EXTRAER = Mid(TextBox1.Text, i, 1) TextBox3.Text = EXTRAER If EXTRAER = "o" Or EXTRAER = "O" Then CONTAR = CONTAR + 1 End If TextBox4.Text = CONTAR Next End Sub Private Sub RadioButton5_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton5.CheckedChanged Dim FRASE As Integer Dim EXTRAER As String
Dim CONTAR As Integer = 0 FRASE = Len(TextBox1.Text) TextBox2.Text = FRASE For i = 1 To FRASE Step 1 EXTRAER = Mid(TextBox1.Text, i, 1) TextBox3.Text = EXTRAER If EXTRAER = "u" Or EXTRAER = "U" Then CONTAR = CONTAR + 1 End If TextBox4.Text = CONTAR Next End Sub End Class
PROGRAMA CONTEO PARES E IMPARES CON INPUTBOX
Public Class Form2 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim CUADRO As Integer Dim RESIDUO As Integer Dim PAR As Integer Dim IMPAR As Integer For I = 1 To 5 Step 1 CUADRO = InputBox("Igrese valores") RESIDUO = CUADRO Mod 2 If RESIDUO = 1 Then IMPAR = IMPAR + 1 Else PAR = PAR + 1 End If Next TextBox6.Text = PAR TextBox7.Text = IMPAR End Sub End Class
PROGRAMA NÚMEROS PRIMOS
Public Class Form1 Private Sub Button1_Click(ByVal Dim N As Integer Dim R As Integer Dim AC As Integer Dim I As Integer N = TextBox1.Text For I = 1 To N R = N Mod I If R = 0 Then AC = AC + 1 End If Next If AC = 2 Then MsgBox("NÚMERO PRIMO" & Else MsgBox("NO ES UN NÚMERO End If End Sub Private Sub Button2_Click(ByVal TextBox1.Text = "" TextBox1.Focus() End Sub Private Sub Button3_Click(ByVal Me.Close() End Sub End Class
sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Chr(5) & "CLICK EN ACEPTAR") PRIMO") sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
PROGRAMA FIBONACII
Public Class Form2 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim ANT As Integer = 0 'Declaración de variables para el primer número Dim SIG As Integer = 1 'Declaración de variables para el segundo número Dim N, I, RES As Integer 'Declaración de variables N = TextBox1.Text TextBox2.Text = ANT & " , " & SIG For I = 1 To N - 2 RES = ANT + SIG TextBox2.Text = TextBox2.Text & " , " & RES ANT = SIG SIG = RES Next End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click TextBox1.Text = "" TextBox2.Text = "" TextBox1.Focus() End Sub Private Sub Button3_Click(sender As System.Object, e As System.EventArgs) Handles Button3.Click End End Sub End Class
PROGRAMA FACTORIAL
Public Class Form3 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim I, F As Integer F = 1 For I = 1 To Val(TextBox1.Text) F = F * I Next TextBox2.Text = F End Sub Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click TextBox1.Text = "" TextBox2.Text = "" End Sub Private Sub Button3_Click(sender As System.Object, e As System.EventArgs) Handles Button3.Click Me.Close() End Sub End Class
PROGRAMA CON WHILE-DO-DOWHILE
Public Class Form1 Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Dim X As Integer Do While X < 10 TextBox3.Text = TextBox3.Text & X.ToString & " " X = X + 1 'X+=1 Loop End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Dim X As Integer Do TextBox2.Text = TextBox2.Text & X.ToString & " " X = X + 1 'X+=1 Loop Until X > 10 End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim X As Integer
While X < 10 TextBox1.Text = TextBox1.Text & X.ToString & " " X = X + 1 'X+=1 End While End Sub Private Sub Button5_Click(sender As System.Object, e As System.EventArgs) Handles Button5.Click TextBox1.Text = "" TextBox2.Text = "" TextBox3.Text = "" End Sub End Class
PROGRAMA CON FOR EACH
Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click For Each DATO As Control In Me.Controls If DATO.GetType().ToString().Contains("Button") Then DATO.BackColor = Color.Blue Else DATO.BackColor = Color.Yellow End If Next End Sub Private Sub Button3_Click(sender As System.Object, e As System.EventArgs) Handles Button3.Click Me.Close() End Sub End Class
PROGRAMA CON VECTORES Y LISTBOX
Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim A(5) As Integer
Dim N As Integer For I = 0 To 4 N = InputBox("Ingrese vector: " & I + 1) ListBox1.Items.Add(N) Next End Sub Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click ListBox1.Items.Clear() End Sub Private Sub Button3_Click(sender As System.Object, e As System.EventArgs) Handles Button3.Click Me.Close() End Sub End Class
PROGRAMA CON VECTORES Y TEXTBOX
Public Class Form2 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim TEXT As TextBox() = New TextBox() {TextBox1, TextBox2, TextBox3, TextBox4, TextBox5} For I = 0 To 4 TEXT(I).Text = InputBox("Ingrese vector:" & I) Next End Sub End Class
PROGRAMA REDIMENSIĂ&#x201C;N DE VECTORES
Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim A(4) As Integer For I = 1 To 4 A(I) = I * 5 ListBox1.Items.Add(A(I)) Next ReDim Preserve A(7) For I = 4 To 7 A(I) = I * 10 Next For I = 1 To 7 ListBox2.Items.Add(A(I)) Next
End Sub Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click ListBox1.Items.Clear() ListBox2.Items.Clear() End Sub Private Sub Button3_Click(sender As System.Object, e As System.EventArgs) Handles Button3.Click Me.Close() End Sub End Class
PROGRAMA REDIMENSIÓN DE VECTORES CON N CANTIDAD DE VECES
Public Class Form3 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim N1, N2, N3 As Integer N1 = InputBox("Ingrese cuántos vectores") Dim VEC(N1) As Integer For I = 1 To N1 VEC(I) = InputBox("Ingrese los vectores") ListBox1.Items.Add(VEC(I)) Next N2 = InputBox("Ingrese redimensión del vector") N3 = N1 + N2 ReDim Preserve VEC(N3) For I = N1 + 1 To N3 VEC(I) = InputBox("Números de vectores a redimensionar") Next For I = 1 To N3 ListBox2.Items.Add(VEC(I)) Next End Sub Private Sub Button4_Click(sender As System.Object, e As System.EventArgs) Handles Button4.Click ListBox1.Items.Clear() End Sub Private Sub Button3_Click(sender As System.Object, e As System.EventArgs) Handles Button3.Click Me.Close() End Sub End Class
PROGRAMA MATRICES CON ESTRUCTURA 2X3 Y 3X2
Public Class Form2 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim mat1(2, 3) As Integer For I = 1 To 2 For J = 1 To 3 mat1(I, J) = InputBox("Ingrese los valores de la matriz") ListBox1.Items.Add(mat1(I, J)) Next Next Dim mat2(3, 2) As Integer For K = 1 To 3 For L = 1 To 2 mat2(K, L) = InputBox("Ingrese los valores de la matriz") ListBox2.Items.Add(mat2(K, L)) Next Next End Sub Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click ListBox1.Items.Clear() ListBox2.Items.Clear() End Sub Private Sub Button3_Click(sender As System.Object, e As System.EventArgs) Handles Button3.Click Me.Close() End Sub End Class
PROGRAMA MATRICES CON ESTRUCTURA 2X3 Y 3X2 Y SU MATRIZ RESULTANTE
Public Class Form3 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim mat1(2, 3) As Integer For I = 1 To 2 For J = 1 To 3 mat1(I, J) = InputBox("Ingrese los valores de la matriz") ListBox1.Items.Add(mat1(I, J)) Next Next Dim mat2(3, 2) As Integer For K = 1 To 3 For L = 1 To 2 mat2(K, L) = InputBox("Ingrese los valores de la matriz") ListBox2.Items.Add(mat2(K, L)) Next Next Dim mat3(2, 2) As Integer Dim ACUM As Integer For M = 1 To 2 For N = 1 To 2 For P = 1 To 3 ACUM = mat1(M, P) * mat2(P, N) + ACUM Next mat3(M, N) = ACUM ListBox3.Items.Add(mat3(M, N)) ACUM = 0 Next Next End Sub Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click ListBox1.Items.Clear() ListBox2.Items.Clear() End Sub Private Sub Button3_Click(sender As System.Object, e As System.EventArgs) Handles Button3.Click Me.Close() End Sub End Class
PROGRAMA MATRICES CON ESTRUCTURA 3X3
Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim mat1(3, 3) As Integer For I = 1 To 3 For J = 1 To 3 mat1(I, J) = InputBox("Ingrese los valores de la matriz") ListBox1.Items.Add(mat1(I, J)) Next Next End Sub Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click ListBox1.Items.Clear() End Sub
Private Sub Button3_Click(sender As System.Object, e As System.EventArgs) Handles Button3.Click Me.Close() End Sub End Class
PROGRAMA MATRICES CON ESTRUCTURA N
Public Class Form4 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim F1 As Integer Dim C1 As Integer Dim F2 As Integer Dim C2 As Integer F1 = InputBox("Ingrese el número de filas de la primera matriz") C1 = InputBox("Ingrese el número de columnas de la primera matriz") F2 = InputBox("Ingrese el número de filas de la segunda matriz") C2 = InputBox("Ingrese el número de columnas de la segunda matriz") If C1 = F2 Then Dim mat1(F1, C1) As Integer For I = 1 To F1 For J = 1 To C1 mat1(I, J) = InputBox("Ingrese los valores de la matriz") ListBox1.Items.Add(mat1(I, J)) Next Next Dim mat2(F2, C2) As Integer For K = 1 To F2 For L = 1 To C2 mat2(K, L) = InputBox("Ingrese los valores de la matriz") ListBox2.Items.Add(mat2(K, L)) Next Next Dim mat3(F1, C2) As Integer Dim ACUM As Integer For M = 1 To F1 For N = 1 To C2 For P = 1 To C1 ACUM = mat1(M, P) * mat2(P, N) + ACUM Next mat3(M, N) = ACUM ListBox3.Items.Add(mat3(M, N)) ACUM = 0 Next Next Else MsgBox("ERROR, NO SE PUEDE REALIZAR LA MULTIPLICACION") End If End Sub Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click ListBox1.Items.Clear() ListBox2.Items.Clear() ListBox3.Items.Clear() End Sub Private Sub Button3_Click(sender As System.Object, e As System.EventArgs) Handles Button3.Click Me.Close() End Sub End Class
PROGRAMA SUMA Y RESTA DE VECTORES
Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click ListBox1.Items.Clear() ListBox2.Items.Clear() ListBox3.Items.Clear() Dim f1 As Integer f1 = InputBox("Ingrese el número de vectores: ") Dim MAT1(f1) As Integer For i = 1 To f1 Dim N As Integer N = N + 1 MAT1(i) = InputBox("Ingrese el número " & N & " de la vector 1:") ListBox2.Items.Add(MAT1(i)) Next Dim MAT(f1) As Integer For i = 1 To f1 Dim M As Integer M = M + 1 MAT(i) = InputBox("Ingrese el número " & M & " de la vector 2:") ListBox1.Items.Add(MAT(i)) Next Dim MAT3(f1) As Integer Dim s As Integer For i = 1 To f1 s = MAT(i) + MAT1(i) MAT3(i) = s ListBox3.Items.Add(MAT3(i)) Next End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click ListBox1.Items.Clear() ListBox2.Items.Clear() ListBox3.Items.Clear() Dim f1 As Integer f1 = InputBox("Ingrese el número de vectores: ") Dim MAT1(f1) As Integer For i = 1 To f1 Dim N As Integer N = N + 1 MAT1(i) = InputBox("Ingrese el número " & N & " de la vector 1:") ListBox2.Items.Add(MAT1(i)) Next Dim MAT(f1) As Integer For i = 1 To f1 Dim M As Integer M = M + 1 MAT(i) = InputBox("Ingrese el número " & M & " de la vector 2:") ListBox1.Items.Add(MAT(i)) Next Dim MAT3(f1) As Integer Dim s As Integer For i = 1 To f1 s = MAT1(i) - MAT(i) MAT3(i) = s ListBox3.Items.Add(MAT3(i)) Next End Sub End Class
PROGRAMA SUMA Y RESTA DE MATRICES
Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click ListBox1.Items.Clear() ListBox2.Items.Clear() ListBox3.Items.Clear() Dim f1, c1 As Integer f1 = InputBox("Ingrese el valor de las filas: ") c1 = InputBox("Ingrese el valor de las columnas: ") Dim MAT1(f1, c1) As Integer For i = 1 To f1 For j = 1 To c1 Dim N As Integer N = N + 1 MAT1(i, j) = InputBox("Ingrese el número " & N & " de la matriz 1:") ListBox2.Items.Add(MAT1(i, j)) Next Next Dim MAT(c1, f1) As Integer For i = 1 To c1 For j = 1 To f1 Dim M As Integer M = M + 1 MAT(i, j) = InputBox("Ingrese el número " & M & " de la matriz 2:") ListBox1.Items.Add(MAT(i, j)) Next Next Dim MAT3(c1, f1) As Integer Dim s As Integer For i = 1 To c1 For j = 1 To f1 s = MAT(i, j) + MAT1(i, j) MAT3(i, j) = s ListBox3.Items.Add(MAT3(i, j)) Next Next End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click ListBox1.Items.Clear() ListBox2.Items.Clear() ListBox3.Items.Clear() Dim f1, c1 As Integer f1 = InputBox("Ingrese el valor de las filas: ") c1 = InputBox("Ingrese el valor de las columnas: ") Dim MAT1(f1, c1) As Integer For i = 1 To f1 For j = 1 To c1 Dim N As Integer N = N + 1 MAT1(i, j) = InputBox("Ingrese el número " & N & " de la matriz 1:") ListBox2.Items.Add(MAT1(i, j)) Next Next Dim MAT(c1, f1) As Integer For i = 1 To c1 For j = 1 To f1 Dim M As Integer M = M + 1 MAT(i, j) = InputBox("Ingrese el número " & M & " de la matriz 2:") ListBox1.Items.Add(MAT(i, j))
Next Next Dim MAT3(c1, f1) As Integer Dim s As Integer For i = 1 To c1 For j = 1 To f1 s = MAT1(i, j) - MAT(i, j) MAT3(i, j) = s ListBox3.Items.Add(MAT3(i, j)) Next Next End Sub End Class
PROGRAMA SISTEMA DE TRES ECUACIONES
Public Class Form1 Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click End End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim TEXT As TextBox() = New TextBox() {TextBox1, TextBox2, TextBox3, TextBox4, TextBox5, TextBox6, TextBox7, TextBox8, TextBox9, TextBox10, TextBox11, TextBox12} 'MATRIZ DETERMINANTE Dim mat1(3, 5) As Integer For i = 0 To 8 mat1(3, 5) = (TEXT(i).Text) ListBox1.Items.Add(mat1(3, 5)) Next For i = 0 To 5 mat1(3, 5) = (TEXT(i).Text) ListBox1.Items.Add(mat1(3, 5)) Next 'PRODUCTO1 Dim A As Integer A = Val(mat1(1, 1)) MsgBox(A) 'MATRIZ X Dim mat2(3, 5) As Integer For i = 9 To 11 mat2(3, 5) = (TEXT(i).Text) ListBox2.Items.Add(mat2(3, 5)) Next
For i = 3 To 8 mat2(3, 5) = (TEXT(i).Text) ListBox2.Items.Add(mat2(3, 5)) Next For i = 9 To 11 mat2(3, 5) = (TEXT(i).Text) ListBox2.Items.Add(mat2(3, 5)) Next For i = 3 To 5 mat2(3, 5) = (TEXT(i).Text) ListBox2.Items.Add(mat2(3, 5)) Next 'MATRIZ Y Dim mat3(3, 5) As Integer For i = 0 To 2 mat3(3, 5) = (TEXT(i).Text) ListBox3.Items.Add(mat3(3, 5)) Next For i = 9 To 11 mat3(3, 5) = (TEXT(i).Text) ListBox3.Items.Add(mat3(3, 5)) Next For i = 6 To 8 mat3(3, 5) = (TEXT(i).Text) ListBox3.Items.Add(mat3(3, 5)) Next For i = 0 To 2 mat3(3, 5) = (TEXT(i).Text) ListBox3.Items.Add(mat3(3, 5)) Next For i = 9 To 11 mat3(3, 5) = (TEXT(i).Text) ListBox3.Items.Add(mat3(3, 5)) Next 'MATRIZ Z Dim mat4(3, 5) As Integer For i = 0 To 5 mat4(3, 5) = (TEXT(i).Text) ListBox4.Items.Add(mat4(3, 5)) Next For i = 9 To 11 mat4(3, 5) = (TEXT(i).Text) ListBox4.Items.Add(mat4(3, 5)) Next For i = 0 To 5 mat4(3, 5) = (TEXT(i).Text) ListBox4.Items.Add(mat4(3, 5)) Next End Sub End Class