Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim food 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 = 35
End If
'漢堡/牛肉
If CheckBox1.Checked Then
food += 75
End If
If CheckBox2.Checked Then
food += 70
End If
If CheckBox3.Checked Then
food += 250
End If
If CheckBox4.Checked Then
food += 499
End If
'飯
If CheckBox5.Checked Then
food += 120
End If
If CheckBox6.Checked Then
food += 99
End If
If CheckBox8.Checked Then
food += 30 + coffee
End If
'飲料
Dim drink As Integer
If RadioButton3.Checked Then
drink += 30
End If
If RadioButton5.Checked Then
drink += 30
End If
'牛排選擇()
If CheckBox1.Checked Then
Form2.Show()
End If
If CheckBox6.Checked Then
Form2.Show()
End If
'飯 checkbox
If CheckBox5.Checked Or CheckBox6.Checked Then
CheckBox9.Checked = True
End If
'薯條 checkbox
If RadioButton1.Checked Or RadioButton2.Checked Then
CheckBox7.Checked = True
End If
'飲料 checkbox
If RadioButton3.Checked Or RadioButton4.Checked Or RadioButton5.Checked Then
CheckBox8.Checked = True
End If
'$$
TextBox1.BackColor = Color.FromArgb(0, 0, 0)
Dim total As Integer
total = food + fries + drink + coffee
TextBox1.Text = Format(total, "c")
End Sub
End Class
=========================================================================
=========================================================================
Public Class Form2
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If RadioButton1.Checked Then
TextBox1.Text = "三分熟"
End If
If RadioButton2.Checked Then
TextBox1.Text = "五分熟"
End If
If RadioButton3.Checked Then
TextBox1.Text = "七分熟"
End If
If RadioButton4.Checked Then
TextBox1.Text = "全熟"
End If
TextBox1.BackColor = Color.Black
TextBox1.ForeColor = Color.White
End Sub
沒有留言:
張貼留言