Visual Basic İle YTL Hesap Makinası

Şimdi sizlere "Visual Basic İle YTL Hesap Makinası" yapma yöntemini Göstereceğim...

Forma 6 adet checkbox, 9 adet label, 2 adet maskedbox, 2 adet command buton ekleyin program hazır...

Kodları Veriyorum

Private Sub Check1_Click()
hesapla
End Sub
Private Sub Check2_Click()
topla
End Sub
Sub topla()
Dim bf, adet, tutar, toplam, a
bf = Val(MaskEdBox1)
adet = Val(MaskEdBox2)
If Check2.Value = 1 Then
toplam = bf * adet * 108 / 100
a = bf * adet * 8 / 100
tutar = bf * adet
Label9.Caption = "%8"
Else
tutar = bf * adet

End If
Label1 = tutar
Label1 = Format(Label1, "#,##0.00 YTL")
Label5 = a
Label5 = Format(Label5, "#,##0.00 YTL")
Label6 = toplam
Label6 = Format(Label6, "#,##0.00 YTL")
End Sub

Sub hesapla()
Dim bf, adet, tutar, toplam, a
bf = Val(MaskEdBox1)
adet = Val(MaskEdBox2)
If Check1.Value = 1 Then
toplam = bf * adet * 118 / 100
a = bf * adet * 18 / 100
tutar = bf * adet
Label9.Caption = "%18"
Else
tutar = bf * adet

End If
Label1 = tutar
Label1 = Format(Label1, "#,##0.00 YTL")
Label5 = a
Label5 = Format(Label5, "#,##0.00 YTL")
Label6 = toplam
Label6 = Format(Label6, "#,##0.00 YTL")
End Sub
Sub işlem()
Dim bf, adet, tutar, toplam, a
bf = Val(MaskEdBox1)
adet = Val(MaskEdBox2)
If Check3.Value = 1 Then
toplam = bf * adet * 101 / 100
a = bf * adet * 1 / 100
tutar = bf * adet
Label9.Caption = "%1"
Else
tutar = bf * adet

End If
Label1 = tutar
Label1 = Format(Label1, "#,##0.00 YTL")
Label5 = a
Label5 = Format(Label5, "#,##0.00 YTL")
Label6 = toplam
Label6 = Format(Label6, "#,##0.00 YTL")
End Sub

Private Sub Check3_Click()
işlem
End Sub
Sub kdv18()
Dim bf, adet, tutar, toplam, a, b
bf = Val(MaskEdBox1)
If Check4.Value = 1 Then
b = bf / 118 * 100
tutar = bf - b
Label9.Caption = "%18"
On Error Resume Next
Else
tutar = bf - b
End If
Label1 = b
Label1 = Format(Label1, "#,##0.00 YTL")
Label5 = tutar
Label5 = Format(Label5, "#,##0.00 YTL")
Label6 = bf
Label6 = Format(Label6, "#,##0.00 YTL")
End Sub
Private Sub Check4_Click()
kdv18
End Sub
Private Sub Check5_Click()
kdv08
End Sub
Sub kdv08()
Dim bf, adet, tutar, toplam, a, b, c
bf = Val(MaskEdBox1)
If Check5.Value = 1 Then
c = bf / 108 * 100
tutar = bf - c
Label9.Caption = "%08"
Else
tutar = bf - c
End If
Label1 = c
Label1 = Format(Label1, "#,##0.00 YTL")
Label5 = tutar
Label5 = Format(Label5, "#,##0.00 YTL")
Label6 = bf
Label6 = Format(Label6, "#,##0.00 YTL")
End Sub
Private Sub Check6_Click()
kdv01
End Sub
Sub kdv01()
Dim bf, adet, tutar, toplam, a, b, c, d
bf = Val(MaskEdBox1)
If Check6.Value = 1 Then
d = bf / 101 * 100
tutar = bf - d
Label9.Caption = "%01"
Else
tutar = bf - d
End If
Label1 = d
Label1 = Format(Label1, "#,##0.00 YTL")
Label5 = tutar
Label5 = Format(Label5, "#,##0.00 YTL")
Label6 = bf
Label6 = Format(Label6, "#,##0.00 YTL")
End Sub
Private Sub Command1_Click()
Label9 = ""
Check1.Value = 0
Check2.Value = 0
Check3.Value = 0
Check4.Value = 0
Check5.Value = 0
Check6.Value = 0
MaskEdBox1 = ""
MaskEdBox2 = ""
Label1 = ""
Label5 = ""
Label6 = ""
MaskEdBox1.SetFocus
End Sub

Private Sub Command2_Click()
End
End Sub

Konular