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 Handles Button1.Click 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 Handles Button2.Click 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 Handles Button3.Click Me.Close() End Sub End Class
System.EventArgs)
System.EventArgs) Then
System.EventArgs)
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
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
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
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 love2.Visible = True Else love2.Visible = False End If End Sub Private Sub Button9_Click(ByVal sender As System.Object, ByVal 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
As System.EventArgs) Handles Timer3.Tick
As System.EventArgs) Handles Timer6.Tick
As System.EventArgs) Handles Timer5.Tick
As System.EventArgs) Handles Timer7.Tick
e As System.EventArgs) Handles Button9.Click
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 = True Label3.Visible = False Label4.Visible = False Case 2 Label1.Visible = False Label3.Visible = True Label4.Visible = False Case 3 Label1.Visible = False Label3.Visible = False Label4.Visible = True End Select End If End Sub End Class
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テ前 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テ前 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