adsense

2010-10-12

[vb] 菜單

Public Class Form1



Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Dim total As Integer = 0

Dim fries As Integer

Dim coffee As Integer

'大小署

If RadioButton1.Checked Then

fries = 25

ElseIf RadioButton2.Checked Then

fries = 35

End If

'咖啡

If RadioButton4.Checked Then

coffee = 5

End If

'計算

If CheckBox1.Checked Then

total = 75

ElseIf CheckBox2.Checked Then

total = 70



ElseIf CheckBox3.Checked Then

total = 250



ElseIf CheckBox4.Checked Then

total = 499

End If

If CheckBox5.Checked Then

total = 120

ElseIf CheckBox6.Checked Then

total = 99

End If

If CheckBox8.Checked Then

total += 30 + coffee

End If

TextBox1.BackColor = Color.FromArgb(0, 0, 0)

Dim a As Integer

a = total + fries

TextBox1.Text = Format(a, "c")



End Sub

End Class

沒有留言:

張貼留言