Senin, 13 Juni 2011

Visual basic Part 8 (Diskon --> If statement )


Private Sub CMDH_Click()
    Dim bayar As Currency
    bayar = Val(TXTB.Text)
    Dim discount1 As Currency
    discount1 = 15 / 100 * bayar
    Dim discount2 As Currency
    discount2 = 25 / 100 * bayar
   
    If 10000 < bayar <= 50000 Then LBLTOT.Caption = bayar - discount1
    If 10000 < bayar <= 50000 Then LBLD.Caption = 15
    If bayar > 50000 Then LBLTOT.Caption = bayar - discount2
    If bayar > 50000 Then LBLD.Caption = 25
    If bayar <= 10000 Then LBLTOT.Caption = bayar
    If bayar <= 10000 Then LBLD.Caption = 0
End Sub


Private Sub CMDHPS_Click()
    TXTB.Text = " "
    LBLTOT.Caption = " "
    LBLD.Caption = " "
End Sub

Private Sub CMDS_Click()
    End
End Sub

Tidak ada komentar:

Posting Komentar