Vbnet Burger

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

vbBURGER

OUTPUT
CODE:
Public Class Form1
Const conDeluxePrice = 500, conSpecialPrice = 350, conPrimoPrice = 150
Private sInitialValue As String

Private Sub Form1_Load_1(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles MyBase.Load
txtQty.Text = sInitialValue
txtAmt.Text = sInitialValue
End Sub

Private Sub rdoKing_CheckedChanged(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles rdoKing.CheckedChanged
CheckBox1.CheckState = 0
CheckBox2.CheckState = 0
CheckBox3.CheckState = 1
CheckBox4.CheckState = 0
CheckBox5.CheckState = 0
CheckBox6.CheckState = 1
CheckBox7.CheckState = 1
txtPrice.Text = Str(conDeluxePrice)
txtQty.Text = sInitialValue
txtAmt.Text = sInitialValue
rdoKing.Checked = True
rdoQueen.Checked = False
rdoRegular.Checked = False
End Sub

Private Sub rdoQueen_CheckedChanged(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles rdoQueen.CheckedChanged
CheckBox1.CheckState = 0
CheckBox2.CheckState = 1
CheckBox3.CheckState = 0
CheckBox4.CheckState = 0
CheckBox5.CheckState = 1
CheckBox6.CheckState = 0
CheckBox7.CheckState = 0
txtPrice.Text = Str(conSpecialPrice)
txtQty.Text = sInitialValue
txtAmt.Text = sInitialValue
rdoKing.Checked = False
rdoQueen.Checked = True
rdoRegular.Checked = False
End Sub

Private Sub rdoRegular_CheckedChanged(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles rdoRegular.CheckedChanged
CheckBox1.CheckState = 1
CheckBox2.CheckState = 0
CheckBox3.CheckState = 0
CheckBox4.CheckState = 1
CheckBox5.CheckState = 0
CheckBox6.CheckState = 0
CheckBox7.CheckState = 0
txtPrice.Text = Str(conPrimoPrice)
txtQty.Text = sInitialValue
txtAmt.Text = sInitialValue
rdoKing.Checked = False
rdoQueen.Checked = False
rdoRegular.Checked = True
End Sub

Private Sub txtQty_TextChanged(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles txtQty.TextChanged
Dim sAmount As Single
sAmount = 0
If rdoKing.Checked Then
sAmount = conDeluxePrice * Val(txtQty.Text)
txtAmt.Text = Str(sAmount)
End If
If rdoQueen.Checked Then
sAmount = conSpecialPrice * Val(txtQty.Text)
txtAmt.Text = Str(sAmount)
End If
If rdoRegular.Checked Then
sAmount = conPrimoPrice * Val(txtQty.Text)
txtAmt.Text = Str(sAmount)
End If
End Sub

Private Sub CheckBox3_CheckedChanged(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles CheckBox3.CheckedChanged

End Sub
End Class

You might also like