Upload
leonel
View
213
Download
0
Embed Size (px)
DESCRIPTION
Â
Citation preview
Leonel Navarrete
Unión de Caracteres
Public Class Form2
Private Sub Button1_Click(ByVal sender AsSystem.Object, ByVal e As System.EventArgs) HandlesButton1.Click
Dim texto1, texto2 As Stringtexto1 = TextBox1.Texttexto2 = TextBox2.TextTextBox3.Text = texto1 + texto2
End Sub
Private Sub Button2_Click(ByVal sender AsSystem.Object, ByVal e As System.EventArgs) HandlesButton2.Click
Dim texto1, texto2 As Stringtexto1 = TextBox1.Texttexto2 = TextBox2.TextTextBox4.Text = texto1 & texto2
End SubEnd Class
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.CrimsonEnd 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
EndEnd 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) HandlesButton2.MouseMove
Me.BackColor = Color.GoldEnd Sub
Private Sub Button3_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button3.DoubleClick
Me.BackColor = Color.CyanEnd Sub
End Class
Leonel Navarrete
Propiedades de los objetos
Public Class Form3
Private Sub Button1_Click(ByVal sender AsSystem.Object, ByVal e As System.EventArgs) HandlesButton1.Click
imagen1.Visible = True
End Sub
Private Sub Button2_Click(ByVal sender AsSystem.Object, ByVal e As System.EventArgs) HandlesButton2.Click
imagen1.Visible = False
End SubEnd Class
Leonel Navarrete
Propiedades de los objetos
Public Class Form4
Private Sub Timer1_Tick(ByVal sender AsSystem.Object, ByVal e As System.EventArgs) HandlesTimer1.Tick
TextBox1.Text = Date.NowTextBox2.Text = TimeOfDay
End Sub
End Class
Leonel Navarrete
Propiedades de los objetos
Public Class Form5
Private Sub cambiar_Click(ByVal sender AsSystem.Object, ByVal e As System.EventArgs) Handlescambiar.Click
nombre.Text = "Programación“
End SubEnd Class
Leonel Navarrete
Propiedades de los objetos
Public Class Form6
Private Sub Button1_Click(ByVal sender AsSystem.Object, ByVal e As System.EventArgs) HandlesButton1.Click
ListBox1.Items.Add(TextBox1.Text)TextBox1.Text = ""TextBox1.Focus()
End SubEnd Class
Leonel Navarrete
Propiedades de los objetos
Public Class Form7
Private Sub CheckBox1_CheckedChanged(ByVal senderAs System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged
TextBox1.Text = "Programación"End Sub
Private Sub CheckBox2_CheckedChanged(ByVal senderAs 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 AsSystem.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 AsSystem.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 AsSystem.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 AsSystem.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 AsSystem.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 AsSystem.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 AsSystem.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 AsSystem.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 AsSystem.EventArgs) Handles Button5.Click
EndEnd Sub
End Class
Leonel Navarrete
Utilizando un Módulo
Module Module1Public Contador As Integer = 0Public u, c, d As ObjectPublic Sub animacion()
If Contador = 3 ThenContador = 0
ElseContador = Contador + 1Select Case Contador
Case 1u.Visible = Truec.Visible = Falsed.Visible = False
Case 2u.Visible = Falsec.Visible = Trued.Visible = False
Case 3u.Visible = Falsec.Visible = Falsed.Visible = True
End SelectEnd If
End SubEnd Module
Leonel Navarrete
Utilizando un Módulo
Public Class Form1Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Loadu = Label1()c = Label2()d = Label3Timer1.Start()
End SubPrivate Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Timer1.Tickanimacion()
End SubPrivate Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.ClickIf TextBox1.Text = "Leo" And Val(TextBox2.Text) = 123 Then
Timer2.Start()Else
MsgBox("Usuario o contraseña incorrecto", MsgBoxStyle.Critical)
End IfEnd SubPrivate Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Timer2.TickProgressBar1.Increment(1)If ProgressBar1.Value = 100 Then
Me.Hide()Form2.Show()Timer2.Stop()
End IfEnd Sub
End Class
Leonel Navarrete
Utilizando un Módulo
Public Class Form2Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
MyBase.Loadu = Label1()c = Label2()d = Label3Timer1.Start()
End Sub
Private Sub SalirToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles SalirToolStripMenuItem.Click
EndEnd Sub
Private Sub CuadradoToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles CuadradoToolStripMenuItem.Click
Me.Hide()Form3.Show()
End Sub
Private Sub RectánguloToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles RectánguloToolStripMenuItem.Click
Me.Hide()Form5.Show()
End Sub
Private Sub TriánguloToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e AsSystem.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 SubPrivate Sub PictureBox1_MouseMove(ByVal sender As Object, ByVal e As
System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseMoveu = 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 AsSystem.Object, ByVal e As System.EventArgs) HandlesMenúPrincipalToolStripMenuItem.Click
Form2.Show()Me.Hide()
End Sub
Private Sub SalirToolStripMenuItem_Click(ByVal sender AsSystem.Object, ByVal e As System.EventArgs) HandlesSalirToolStripMenuItem.Click
EndEnd Sub
Private Sub Form3_Load(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles MyBase.Load
u = Label1()c = Label2()d = Label3Timer1.Start()
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles Timer1.Tick
animacion()End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles Button1.Click
Label7.Text = Val(TextBox1.Text) * 4Label8.Text = Val(TextBox1.Text) * Val(TextBox1.Text)
End SubEnd Class
Leonel Navarrete
Utilizando un Módulo
Public Class Form4
Private Sub MenúPrincipalToolStripMenuItem_Click(ByVal sender AsSystem.Object, ByVal e As System.EventArgs) HandlesMenú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
EndEnd Sub
Private Sub Form4_Load(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles MyBase.Load
u = Label1()c = Label2()d = Label3Timer1.Start()
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e AsSystem.EventArgs)
animacion()End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles Button1.Click
Label7.Text = Val(TextBox1.Text) * 2 + Val(TextBox2.Text) * 2Label8.Text = Val(TextBox1.Text) * Val(TextBox2.Text)
End SubEnd Class
Leonel Navarrete
Utilizando un Módulo
Public Class Form5
Private Sub MenúPrincipalToolStripMenuItem_Click(ByVal sender AsSystem.Object, ByVal e As System.EventArgs) HandlesMenú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
EndEnd Sub
Private Sub Form5_Load(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles MyBase.Load
u = Label1()c = Label2()d = Label3Timer1.Start()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e AsSystem.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 SubEnd Class
Leonel Navarrete
Boolean
Public Class Form3
Private Sub Button1_Click(ByVal sender AsSystem.Object, ByVal e As System.EventArgs) HandlesButton1.Click
Dim A As IntegerDim RES As BooleanA = TextBox1.TextRES = Not (A + 10 < 20)MsgBox(RES)
End SubPrivate Sub Button2_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) HandlesButton2.Click
EndEnd Sub
End Class
Leonel Navarrete
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e AsSystem.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 AsSystem.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 AsSystem.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 AsSystem.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 AsSystem.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 AsSystem.EventArgs) Handles Button6.Click
N3.Text = Val(N1.Text) ^ Val(N2.Text)End SubPrivate Sub Button7_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button7.ClickN3.Text = Val(N1.Text) Mod Val(N2.Text)
End SubPrivate Sub Button10_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button10.ClickN1.Text = ""N2.Text = ""N3.Text = ""N1.Focus()
End SubPrivate Sub Button8_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button8.ClickMe.Close()
End SubPrivate Sub Button9_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button9.ClickMe.Hide()Form2.show()
End SubEnd Class
Leonel Navarrete
Public Class Form2
Private Sub salario_Click(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles salario.Click
Dim SB, HT, PPH, D, SN As DoubleHT = Val(HORAST.Text)PPH = Val(PAGOH.Text)SB = HT * PPHD = SB * 0.2SN = SB - DSALARION.Text = SN
End Sub
Private Sub Button10_Click(ByVal sender As System.Object, ByVal e AsSystem.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 AsSystem.EventArgs) Handles Button8.Click
Form1.Close()
End Sub
Private Sub Button9_Click(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles Button9.Click
Form3.Show()Me.Hide()
End SubEnd 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, TC = Val(CANT.Text)V = Val(VUNI.Text)VT = C * VI = VT * 0.12T = VT + IListBox1.Items.Add(PROD.Text)VTOTAL.Text = VTIVA.Text = ITOTAL.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 SubEnd Class
Leonel Navarrete
MouseMove
Public Class Form4
Private Sub PictureBox1_MouseMove(ByVal sender As Object, ByVal e AsSystem.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseMove
RESP.Text = "MONITOR"End SubPrivate Sub PictureBox2_MouseMove(ByVal sender As Object, ByVal e As
System.Windows.Forms.MouseEventArgs) Handles PictureBox2.MouseMoveRESP.Text = "TECLADO"
End SubPrivate Sub PictureBox3_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles PictureBox3.ClickEnd SubPrivate Sub PictureBox3_MouseMove(ByVal sender As Object, ByVal e As
System.Windows.Forms.MouseEventArgs) Handles PictureBox3.MouseMoveRESP.Text = "RATÓN"
End SubPrivate Sub PictureBox4_MouseMove(ByVal sender As Object, ByVal e As
System.Windows.Forms.MouseEventArgs) Handles PictureBox4.MouseMoveRESP.Text = "CPU"
End SubPrivate Sub Button10_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button10.ClickRESP.Text = ""
End SubPrivate Sub Button8_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button8.ClickForm1.Close()
End SubPrivate Sub Button9_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button9.ClickForm5.Show()Me.Hide()
End SubEnd Class
Leonel Navarrete
Public Class Form5Private Sub Button1_Click(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles Button1.ClickTextBox1.ForeColor = Color.Red
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVale As System.EventArgs) Handles Button2.Click
Me.BackColor = Color.BlackEnd Sub
Private Sub Button10_Click(ByVal sender As System.Object, ByVale As System.EventArgs) Handles Button10.Click
Me.BackColor = Color.WhiteTextBox1.ForeColor = Color.BlackTextBox1.Text = ""TextBox1.Focus()
End Sub
Private Sub Button8_Click(ByVal sender As System.Object, ByVale As System.EventArgs) Handles Button8.Click
Form1.Close()End Sub
Private Sub Button9_Click(ByVal sender As System.Object, ByVale As System.EventArgs) Handles Button9.Click
Form1.Show()Me.Hide()
End SubEnd Class