牛排多選單程式碼
If Cb1.Checked Then
Else
Cb2.Checked = False
Private Sub B1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles B1.Click
Dim c1, c2, c3
Dim s1, s2, s3
If Cb1.Checked Then
c1 = 190
s1 = Cb1.Text
Else
c1 = 0
s1 = ""
End If
If Cb2.Checked Then
c2 = 180
s2 = Cb2.Text
Else
c2 = 0
s2 = ""
End If
If Cb3.Checked Then
c3 = 150
s3 = Cb3.Text
Else
c3 = 0
s3 = ""
End If
L1.Text = "你的選擇:" & s1 & s2 & s3 & " 應付" & (c1 + c2 + c3) & "元"
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Cb1.Checked = False
Cb2.Checked = False
Cb3.Checked = False
End Sub
End Class
全站熱搜
留言列表