Public Class Form1
Dim Variabel1 As Integer
Dim Variabel2 As Integer
Dim hasil As VariantType
Dim HasilPerbandingan As Boolean
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Text1.Text = ""
Text2.Text = ""
LblHasil.Text = 0
End Sub
Private Sub OptTambah_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OptTambah.CheckedChanged
Variabel1 = Text1.Text
Variabel2 = Text2.Text
hasil = Variabel1 + Variabel2
LblHasil.Text = hasil
End Sub
Private Sub OptKurang_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OptKurang.CheckedChanged
Variabel1 = Text1.Text
Variabel2 = Text2.Text
hasil = Variabel1 - Variabel2
LblHasil.Text = hasil
End Sub
Private Sub OptKali_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OptKali.CheckedChanged
Variabel1 = Text1.Text
Variabel2 = Text2.Text
hasil = Variabel1 * Variabel2
LblHasil.Text = hasil
End Sub
Private Sub OptBagi_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OptBagi.CheckedChanged
Variabel1 = Text1.Text
Variabel2 = Text2.Text
hasil = Variabel1 / Variabel2
LblHasil.Text = hasil
End Sub
Private Sub OptDan_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OptDan.CheckedChanged
Variabel1 = Text1.Text
Variabel2 = Text2.Text
hasil = Variabel1 & Variabel2
LblHasil.Text = hasil
End Sub
Private Sub OptMod_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OptMod.CheckedChanged
Variabel1 = Text1.Text
Variabel2 = Text2.Text
hasil = Variabel1 Mod Variabel2
LblHasil.Text = hasil
End Sub
Private Sub OptLbhBsr_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OptLbhBsr.CheckedChanged
Variabel1 = Text1.Text
Variabel2 = Text2.Text
HasilPerbandingan = (Variabel1 > Variabel2)
LblHasil.Text = HasilPerbandingan
End Sub
Private Sub OptLbhKcl_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OptLbhKcl.CheckedChanged
Variabel1 = Text1.Text
Variabel2 = Text2.Text
HasilPerbandingan = (Variabel1 < Variabel2)
LblHasil.Text = HasilPerbandingan
End Sub
Private Sub OptSmDgn_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OptSmDgn.CheckedChanged
Variabel1 = Text1.Text
Variabel2 = Text2.Text
HasilPerbandingan = (Variabel1 = Variabel2)
LblHasil.Text = HasilPerbandingan
End Sub
Private Sub OptTdkSmDgn_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OptTdkSmDgn.CheckedChanged
Variabel1 = Text1.Text
Variabel2 = Text2.Text
HasilPerbandingan = (Variabel1 <> Variabel2)
LblHasil.Text = HasilPerbandingan
End Sub
Private Sub OptLbhBsrSmDgn_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OptLbhBsrSmDgn.CheckedChanged
Variabel1 = Text1.Text
Variabel2 = Text2.Text
HasilPerbandingan = (Variabel1 >= Variabel2)
LblHasil.Text = HasilPerbandingan
End Sub
Private Sub OptLbhKclSmDgn_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OptLbhKclSmDgn.CheckedChanged
Variabel1 = Text1.Text
Variabel2 = Text2.Text
HasilPerbandingan = (Variabel1 <= Variabel2)
LblHasil.Text = HasilPerbandingan
End Sub
End Class
Komentar
Posting Komentar