Programación .NET

Page 1

NAVARRETE MONTENEGRO ERIK LEONEL Leonel Navarrete


Uni贸n de 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(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Dim texto1, texto2 As String texto1 = TextBox1.Text texto2 = TextBox2.Text TextBox4.Text = texto1 & texto2 End Sub End Class Leonel Navarrete


Manipular caracteres con MID Dise帽o

Ejecuci贸n

Programaci贸n

Leonel Navarrete


Manipular caracteres con LEN Dise帽o

Ejecuci贸n

Programaci贸n

Leonel Navarrete


Manipular caracteres con LEFT Dise帽o

Ejecuci贸n

Programaci贸n

Leonel Navarrete


Manipular caracteres con RIGHT Dise帽o

Ejecuci贸n

Programaci贸n

Leonel Navarrete


Manipular caracteres con SPACE Dise帽o

Ejecuci贸n

Programaci贸n

Leonel Navarrete


Manipular caracteres con TRIM Dise帽o

Ejecuci贸n

Programaci贸n

Leonel Navarrete


Enlazar Formularios

Programaci贸n Form 1

Leonel Navarrete


Enlazar Formularios

Programaci贸n Form 2

Leonel Navarrete


Convertir Caracteres

Programaci贸n Form 1

Leonel Navarrete


Convertir Caracteres

Programaci贸n Form 2

Leonel Navarrete


EDADES

Leonel Navarrete


System IO

Leonel Navarrete


Select Case

Con LABEL

Leonel Navarrete


Select Case

Con MSGBOX

MsgBox

Leonel Navarrete


Usuario y Contrase単a

Leonel Navarrete


Usuario y Contrase単a con Progress Bar

Leonel Navarrete


Juego de Cartas

Leonel Navarrete


Juego de Cartas

Leonel Navarrete


Funciones Y Procedimientos

Leonel Navarrete


Funciones Y Procedimientos

Leonel Navarrete


Funciones Y Procedimientos

Leonel Navarrete


Funciones Y Procedimientos

ANIMACIĂ“N DE LETRAS

Leonel Navarrete


Propiedades de los objetos

Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Me.BackColor = Color.Crimson 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.Blue End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click End End Sub End Class

Leonel Navarrete


Propiedades de los objetos

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.Gold End Sub

Private Sub Button3_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button3.DoubleClick Me.BackColor = Color.Cyan End Sub End Class

Leonel Navarrete


Propiedades de los objetos

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

Leonel Navarrete


Propiedades de los objetos

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

Leonel Navarrete


Propiedades de los objetos

Public Class Form5 Private Sub cambiar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cambiar.Click nombre.Text = "Programación“ End Sub End Class

Leonel Navarrete


Propiedades de los objetos

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 End Class

Leonel Navarrete


Propiedades de los objetos

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

Leonel Navarrete


Propiedades de los objetos

Public Class Form8 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) 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 Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click num3.Text = Val(num1.Text) - Val(num2.Text) End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click num3.Text = Val(num1.Text) * Val(num2.Text) End Sub Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click num3.Text = Val(num1.Text) / Val(num2.Text) End Sub

Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click Me.Close() End Sub End Class

Leonel Navarrete


Propiedades de los objetos

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 Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click End End Sub End Class Leonel Navarrete


Utilizando un M贸dulo Module Module1 Public Contador As Integer = 0 Public u, c, d As Object Public Sub animacion() If Contador = 3 Then Contador = 0 Else Contador = Contador + 1 Select Case Contador Case 1 u.Visible = True c.Visible = False d.Visible = False Case 2 u.Visible = False c.Visible = True d.Visible = False Case 3 u.Visible = False c.Visible = False d.Visible = True End Select End If End Sub End Module

Leonel Navarrete


Utilizando un M贸dulo

Public Class Form1 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load u = Label1() c = Label2() d = Label3 Timer1.Start() End Sub Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick animacion() End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If TextBox1.Text = "Leo" And Val(TextBox2.Text) = 123 Then Timer2.Start() Else MsgBox("Usuario o contrase帽a incorrecto", MsgBoxStyle.Critical) End If End Sub Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick ProgressBar1.Increment(1) If ProgressBar1.Value = 100 Then Me.Hide() Form2.Show() Timer2.Stop() End If End Sub End Class Leonel Navarrete


Utilizando un Mรณdulo

Public Class Form2 Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load u = Label1() c = Label2() d = Label3 Timer1.Start() End Sub Private Sub SalirToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SalirToolStripMenuItem.Click End End Sub Private Sub CuadradoToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CuadradoToolStripMenuItem.Click Me.Hide() Form3.Show() End Sub Private Sub RectรกnguloToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RectรกnguloToolStripMenuItem.Click Me.Hide() Form5.Show() End Sub Private Sub TriรกnguloToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TriรกnguloToolStripMenuItem.Click Me.Hide() Form4.Show() End Sub Private Sub Timer1_Tick_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick animacion() End Sub Private Sub PictureBox1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseMove u = Label1() c = Label2() d = Label3() Timer1.Start() End Sub End Class

Leonel Navarrete


Utilizando un Módulo

Public Class Form3 Private Sub MenúPrincipalToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenúPrincipalToolStripMenuItem.Click Form2.Show() Me.Hide() End Sub Private Sub SalirToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SalirToolStripMenuItem.Click End End Sub Private Sub Form3_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load u = Label1() c = Label2() d = Label3 Timer1.Start() End Sub Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick animacion() End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Label7.Text = Val(TextBox1.Text) * 4 Label8.Text = Val(TextBox1.Text) * Val(TextBox1.Text) End Sub End Class Leonel Navarrete


Utilizando un Módulo

Public Class Form4 Private Sub MenúPrincipalToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenúPrincipalToolStripMenuItem.Click Form2.Show() Me.Hide() End Sub Private Sub SalirToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SalirToolStripMenuItem.Click End End Sub Private Sub Form4_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load u = Label1() c = Label2() d = Label3 Timer1.Start() End Sub Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) animacion() End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Label7.Text = Val(TextBox1.Text) * 2 + Val(TextBox2.Text) * 2 Label8.Text = Val(TextBox1.Text) * Val(TextBox2.Text) End Sub End Class Leonel Navarrete


Utilizando un Módulo

Public Class Form5 Private Sub MenúPrincipalToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenúPrincipalToolStripMenuItem.Click Form2.Show() Me.Hide() End Sub Private Sub SalirToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SalirToolStripMenuItem.Click End End Sub Private Sub Form5_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load u = Label1() c = Label2() d = Label3 Timer1.Start() End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim p, h As Double Label7.Text = Val(TextBox1.Text) + Val(TextBox2.Text) + Val(TextBox3.Text) p = (Val(Label7.Text) / 2) h = (p * (p - Val(TextBox1.Text)) * (p - Val(TextBox2.Text)) * (p Val(TextBox3.Text))) ^ (1 / 2) Label8.Text = (Val(TextBox1.Text) * h) / 2 End Sub End Class Leonel Navarrete


Boolean

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 End End Sub End Class Leonel Navarrete


Aplicaci贸n 1

Leonel Navarrete


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 Leonel Navarrete


Public Class Form2 Private Sub salario_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles salario.Click Dim SB, HT, PPH, D, SN As Double HT = Val(HORAST.Text) PPH = Val(PAGOH.Text) SB = HT * PPH D = SB * 0.2 SN = SB - D SALARION.Text = SN End Sub Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button10.Click NOMBREA.Text = "" HORAST.Text = "" PAGOH.Text = "" SALARION.Text = "" 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 Form3.Show() Me.Hide() End Sub End Class Leonel Navarrete


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 Leonel Navarrete


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Ă“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 Form1.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 Leonel Navarrete


Public Class Form5 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click TextBox1.ForeColor = Color.Red End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Me.BackColor = Color.Black End Sub Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button10.Click Me.BackColor = Color.White TextBox1.ForeColor = Color.Black TextBox1.Text = "" TextBox1.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 Form1.Show() Me.Hide() End Sub End Class Leonel Navarrete


Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.