This document contains code for a form application with the following functionality:
- It initializes all text boxes to 0 when the form loads.
- It resets all text boxes to 0 when a button is clicked.
- It calculates values for text boxes based on values entered in other text boxes, checking that values are numeric, and displaying messages if not.
This document contains code for a form application with the following functionality:
- It initializes all text boxes to 0 when the form loads.
- It resets all text boxes to 0 when a button is clicked.
- It calculates values for text boxes based on values entered in other text boxes, checking that values are numeric, and displaying messages if not.
This document contains code for a form application with the following functionality:
- It initializes all text boxes to 0 when the form loads.
- It resets all text boxes to 0 when a button is clicked.
- It calculates values for text boxes based on values entered in other text boxes, checking that values are numeric, and displaying messages if not.
Private Sub form1_load(sender As Object, e As EventArgs) Handles MyBase.Load
Txt_LInap.Text = "0" Txt_BSK.Text = "0" Txt_HSP.Text = "0" Txt_JB.Text = "0" Txt_K.Text = "0" End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Me.Close() End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Txt_LInap.Text = "0" Txt_BSK.Text = "0" Txt_HSP.Text = "0" Txt_JB.Text = "0" Txt_K.Text = "0" End Sub Private Sub Txt_LInap_KTextChangedeyUp(sender As Object, e As KeyEventArgs) Handles Txt_LInap.TextChanged If IsNumeric(Txt_LInap) Then Txt_BSK.Text = Txt_LInap.Text * Txt_HSP.Text Txt_K.Text = Txt_JB.Text - Txt_BSK.Text Else Txt_LInap.Text = 0 MsgBox("Mohon Masukan Angka") Txt_BSK.Text = Txt_LInap.Text * Txt_HSP.Text Txt_K.Text = Txt_JB.Text - Txt_BSK.Text End If End Sub
Private Sub Txt_JB_TextChange(sender As Object, e As EventArgs) Handles
Txt_JB.TextChanged If IsNumeric(Txt_JB.Text) Then Txt_BSK.Text = Txt_LInap.Text * Txt_HSP.Text Txt_K.Text = Txt_JB.Text - Txt_BSK.Text Else Txt_JB.Text = 0 MsgBox("Mohon inputkan angka!") Txt_BSK.Text = Txt_LInap.Text * Txt_HSP.Text Txt_K.Text = Txt_JB.Text - Txt_BSK.Text End If End Sub End Class