In this exercise, you modify the Gross Pay application from this chapter’s Focus lesson. Use Windows to make a copy of the Gross Solution folder. Rename the copy Gross Solution-Functions. Open the Gross Solution.sln file contained in the Gross Solution-Functions folder. Change the two independent Sub procedures to functions named GetWeekly and GetTwicePerMonth. Modify the code so that the btnCalc_Click procedure (rather than the two functions) displays the gross pay in the lblGross control. Save the solution and then start and test the application. Need this in VB please.
In this exercise, you modify the Gross Pay application from this chapter’s Focus lesson. Use Windows to make a copy of the Gross Solution folder. Rename the copy Gross Solution-Functions. Open the Gross Solution.sln file contained in the Gross Solution-Functions folder. Change the two independent Sub procedures to functions named GetWeekly and GetTwicePerMonth. Modify the code so that the btnCalc_Click procedure (rather than the two functions) displays the gross pay in the lblGross control. Save the solution and then start and test the application. Need this in VB please.
Code given:
Option Explicit On
Option Strict On
Option Infer Off
Public Class frmMain
' Independent Sub procedures.
Private Sub btnCalc_Click(sender As Object, e As EventArgs) Handles btnCalc.Click
' Calls independent Sub procedures to calculate and display the gross pay.
End Sub
Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click
Me.Close()
End Sub
Private Sub txtSalary_Enter(sender As Object, e As EventArgs) Handles txtSalary.Enter
txtSalary.SelectAll()
End Sub
Private Sub ClearGross(sender As Object, e As EventArgs) Handles txtSalary.TextChanged, radWeekly.CheckedChanged, radTwicePerMonth.CheckedChanged
lblGross.Text = String.Empty
End Sub
Private Sub txtSalary_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtSalary.KeyPress
' Accept only numbers and the Backspace key
If (e.KeyChar < "0" OrElse e.KeyChar > "9") AndAlso e.KeyChar <> ControlChars.Back Then
e.Handled = True
End If
End Sub
Private Sub frmMain_Load(sender As Object, e As EventArgs) Handles MyBase.Load
End Sub
End Class
Trending now
This is a popular solution!
Step by step
Solved in 3 steps