Sunteți pe pagina 1din 3

COMPUTACION I

(VISUAL BASIC)
1)
Public Class FRMAPLICA1
Private Sub FRMAPLICA1_Load(ByVal sender As
System.Object, ByVal e As System.EventArgs)
Handles MyBase.Load
LBNOMBRE.Text = "JHON AVENDAO AGUEDO"
LBNOMBRE.ForeColor = Color.Red
LBNOMBRE.BackColor = Color.White
LBCURSO.Text = "VISUAL NET"
LBEDAD.Text = 35
End Sub
End Class

TXTP1.Focus()
End Sub
Private Sub BTNSALIR_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs)
Handles BTNSALIR.Click
'end
Me.Close()
End Sub
End Class

3)
Public Class FRMAPLICA3

2)
Public Class FRMAPLICA2
Private Sub BTNCALCULAR_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs)
Handles BTNCALCULAR.Click
Dim N1, N2, N3, PROM As Integer
N1 = Integer.Parse(TXTP1.Text)
N2 = Integer.Parse(TXTEP.Text)
N3 = Integer.Parse(TXTEF.Text)
PROM = (N1 + N2 + N3) / 3
If PROM >= 14 Then
TXTCONDICION.Text = "APROBADO"
Else
TXTCONDICION.Text = "DESAPROBADO"
End If
TXTPROM.Text = PROM
End Sub
Private Sub BTNNUEVO_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs)
Handles BTNNUEVO.Click
TXTP1.Clear()
TXTEP.Clear()
TXTEF.Clear()
TXTPROM.Clear()
TXTCONDICION.Clear()

Private Sub TXTNOM_KeyPress(ByVal sender As


Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles
TXTNOM.KeyPress
If Not (Char.IsLetter(e.KeyChar) Or
Asc(e.KeyChar) = 32 Or Asc(e.KeyChar) = 8) Then
e.Handled = False
End If
End Sub
Private Sub TXTHORAS_KeyPress(ByVal sender As
Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles
TXTHORAS.KeyPress
If Not (Char.IsDigit(e.KeyChar)) Then
e.Handled = True
End If
End Sub
Private Sub TXTPAGO_KeyPress(ByVal sender As
Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles
TXTPAGO.KeyPress
If Not (Char.IsDigit(e.KeyChar)) Then
e.Handled = True
End If
End Sub

Private Sub TXTTS_KeyPress(ByVal sender As Object,


ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles
TXTTS.KeyPress
If Not (Char.IsDigit(e.KeyChar)) Then
e.Handled = True
End If
End Sub
Private Sub BTNCALCULAR_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs)
Handles BTNCALCULAR.Click
Dim horas, ts As Integer
Dim pago, hb, b1, b2, neto As Double
horas = Integer.Parse(TXTHORAS.Text)
pago = Double.Parse(TXTPAGO.Text)
ts = Integer.Parse(TXTTS.Text)
hb = horas * pago
If ts <= 5 Then
b1 = hb * 0.05
ElseIf ts >= 6 And ts <= 10 Then
b1 = hb * 0.08
ElseIf ts >= 11 And ts <= 15 Then
b1 = hb * 0.1
Else
b1 = hb * 0.12
End If
b2 = hb * 9 / 100
neto = hb + b1 + b2
TXTHB.Text = hb
TXTBTS.Text = b1
TXTBE.Text = b2
TXTNETO.Text = neto
End Sub
Private Sub BTNNUEVO_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs)
Handles BTNNUEVO.Click
TXTNOM.Clear()
TXTHORAS.Clear()
TXTTS.Clear()
TXTPAGO.Clear()
TXTHB.Clear()
TXTBTS.Clear()
TXTBE.Clear()
TXTNETO.Clear()
TXTNOM.Focus()
End Sub

4)
Public Class FRMAPLICA4
Private Sub TXTUSUARIO_KeyPress(ByVal sender As
Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles
TXTUSUARIO.KeyPress
If Asc(e.KeyChar) = 13 Then
TXTCLAVE.Focus()
End If
End Sub

Private Sub BTNSALIR_Click(ByVal sender As


Private Sub BTNACEPTAR_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs)
System.Object,
ByVal e As System.EventArgs)
Handles BTNSALIR.Click
Handles BTNACEPTAR.Click
Dim RES As Integer
Dim VarUsuario, VarClave As String
RES = MsgBox("Esta seguro de Salir?",
VarUsuario = "JHON"
MsgBoxStyle.YesNo + MsgBoxStyle.Question, "Aviso")
VarClave = "12345"
If RES = vbYes Then
If TXTUSUARIO.Text = VarUsuario And
'Me.Close()
TXTCLAVE.Text
= VarClave Then
Application.Exit()
Me.Hide()
End If
FRMAPLICA3.ShowDialog()
End Sub
Else
MessageBox.Show("Acceso Denegado", "Aviso",
End Class
MessageBoxButtons.OK, MessageBoxIcon.Warning)
End If
End Sub

Private Sub PictureBox1_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs)
Handles PictureBox1.Click
End Sub
End Class