0% found this document useful (0 votes)
41 views

Public Class Dim As Single Dim As Integer Private Sub Byval As Byval As Handles If Then

The document contains code for a VB.NET Windows Forms application that handles user input and calculations. It defines classes and handlers for buttons, text boxes, list boxes, and radio buttons to collect data, perform calculations, and display results when buttons are clicked. Calculations include counting values, summing scores, and computing salaries based on hours worked, marital status, and number of children. The code clears all fields and selections when a reset button is clicked.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
41 views

Public Class Dim As Single Dim As Integer Private Sub Byval As Byval As Handles If Then

The document contains code for a VB.NET Windows Forms application that handles user input and calculations. It defines classes and handlers for buttons, text boxes, list boxes, and radio buttons to collect data, perform calculations, and display results when buttons are clicked. Calculations include counting values, summing scores, and computing salaries based on hours worked, marital status, and number of children. The code clears all fields and selections when a reset button is clicked.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

Public Class Form1

Dim nombre(100) As Single


Dim contador As Integer = 0

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e


As System.EventArgs) Handles Button1.Click
If TextBox1.Text <> "" Then
ListBox1.Items.Add(TextBox1.Text)
TextBox1.Text = ""
contador = contador + 1
TextBox2.Text = Val(contador)
ListBox1.Sorted = True
TextBox1.Focus()
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles Button2.Click
TextBox1.Text = ""
TextBox2.Text = ""
ListBox1.Items.Clear()

End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e


As System.EventArgs) Handles Button3.Click
End
End Sub

End Class
Public Class Form1

Dim sexo As Single


Dim serie As Single
Dim varones As Integer = 0
Dim mujeres As Integer = 0
Dim suma As Integer = 0
Dim cantidad As Integer = 0
Dim maximo As Integer

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e


As System.EventArgs) Handles Button1.Click
Select Case sexo
Case 1
varones = varones + 1
TextBox2.Text = Val(varones)
Case 2
mujeres = mujeres + 1
TextBox3.Text = Val(mujeres)

End Select
Select Case serie
Case 100
maximo = 40
Case 200
maximo = 60
Case 300
maximo = 70
Case 400
maximo = 85
Case 500
maximo = 95
End Select
suma = 8
cantidad = 1
If suma < maximo Then
suma = suma + 10
cantidad = cantidad + 1
If suma < maximo Then
suma = suma + 11
cantidad = cantidad + 1
If cantidad = cantidad + 1 Then
suma = suma + 12
cantidad = cantidad + 1
If suma < maximo Then
suma = suma + 13
cantidad = cantidad + 1
If suma < maximo Then
suma = suma + 14
cantidad = cantidad + 1
If suma < maximo Then
suma = suma + 15
cantidad = cantidad + 1
If suma < maximo Then
suma = suma + 16
cantidad = cantidad + 1
End If
End If
End If
End If
End If
End If
End If
ListBox1.Items.Add(TextBox1.Text)
ListBox2.Items.Add(Val(serie))
ListBox3.Items.Add(Val(cantidad))

End Sub

Private Sub RadioButton6_CheckedChanged(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
RadioButton6.CheckedChanged
sexo = 1
End Sub

Private Sub RadioButton7_CheckedChanged(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
RadioButton7.CheckedChanged
sexo = 2
End Sub
Private Sub RadioButton1_CheckedChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
RadioButton1.CheckedChanged
serie = 100
End Sub

Private Sub RadioButton2_CheckedChanged(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
RadioButton2.CheckedChanged
serie = 200
End Sub

Private Sub RadioButton3_CheckedChanged(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
RadioButton3.CheckedChanged
serie = 300
End Sub

Private Sub RadioButton4_CheckedChanged(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
RadioButton4.CheckedChanged
serie = 400
End Sub

Private Sub RadioButton5_CheckedChanged(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
RadioButton5.CheckedChanged
serie = 500
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 = ""
ListBox1.Items.Clear()
ListBox2.Items.Clear()
ListBox3.Items.Clear()

End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e


As System.EventArgs) Handles Button3.Click
End

End Sub
End Class
Public Class Form1
Dim trab As Single
Dim estadocivil As Single
Dim cantidadhijos As Single
Dim horastrab(100) As Single
Dim pagoporhoras(100) As Single
Dim salariobrut(100) As Single
Dim desc(100) As Single
Dim aument(100) As Single
Dim salarionet(100) As Single

Private Sub RadioButton1_CheckedChanged(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
RadioButton1.CheckedChanged
estadocivil = 1
If RadioButton1.Checked Then
Else

End If
End Sub

Private Sub RadioButton2_CheckedChanged(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
RadioButton2.CheckedChanged
estadocivil = 2
End Sub

Private Sub RadioButton3_CheckedChanged(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
RadioButton3.CheckedChanged
cantidadhijos = 1
End Sub
Private Sub RadioButton4_CheckedChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
RadioButton4.CheckedChanged
cantidadhijos = 2
End Sub

Private Sub RadioButton5_CheckedChanged(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
RadioButton5.CheckedChanged
cantidadhijos = 3
End Sub

Private Sub RadioButton6_CheckedChanged(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
RadioButton6.CheckedChanged
cantidadhijos = 4
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e


As System.EventArgs) Handles Button1.Click
salariobrut(100) = Val(TextBox2.Text) * Val(TextBox3.Text)
desc(100) = salariobrut(100) * 0.8 + salariobrut(100) * 0.02 +
salariobrut(100) * 0.12
Select (estadocivil)
Case 1
aument(100) = 0
Case 2
Select Case cantidadhijos
Case 1
aument(100) = salariobrut(100) * 0.05
Case 2
aument(100) = salariobrut(100) * 0.07
Case 3
aument(100) = salariobrut(100) * 0.12
Case 4
aument(100) = salariobrut(100) * 0.18
End Select
End Select
TextBox4.Text = salariobrut(100)
TextBox7.Text = aument(100)
TextBox5.Text = desc(100)
TextBox6.Text = salarionet(100)

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 = ""
TextBox4.Text = ""
TextBox5.Text = ""
TextBox6.Text = ""
TextBox7.Text = ""
RadioButton1.Checked = False
RadioButton2.Checked = False
RadioButton3.Checked = False
RadioButton4.Checked = False
RadioButton5.Checked = False
RadioButton6.Checked = False
TextBox1.Focus()
End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e


As System.EventArgs) Handles Button3.Click
End
End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles MyBase.Load

End Sub
End Class

You might also like