2008-03-27 08:49:50,,飛ㄦ*
販賣機
請將程式碼打在”計算”這個按鈕裡面
radiobutton1 = 珍珠奶茶
radiobutton2 = 綠豆沙
radiobutton3 = 大
radiobutton4 = 中
radiobutton5 = 小
label3 = 在金額的那格框框裡面(我把名稱刪除而已)
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If RadioButton1.Checked = True Then
If RadioButton3.Checked = True Then
Label3.Text = TextBox1.Text * 35
Else
If RadioButton4.Checked = True Then
Label3.Text = TextBox1.Text * 25
Else
If RadioButton5.Checked = True Then
Label3.Text = TextBox1.Text * 15
End If
End If
End If
End If
If RadioButton2.Checked = True Then
If RadioButton3.Checked = True Then
Label3.Text = TextBox1.Text * 30
Else
If RadioButton4.Checked = True Then
Label3.Text = TextBox1.Text * 25
Else
If RadioButton5.Checked = True Then
Label3.Text = TextBox1.Text * 20
End If
End If
End If
End If
End Sub
radiobutton1 = 珍珠奶茶
radiobutton2 = 綠豆沙
radiobutton3 = 大
radiobutton4 = 中
radiobutton5 = 小
label3 = 在金額的那格框框裡面(我把名稱刪除而已)
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If RadioButton1.Checked = True Then
If RadioButton3.Checked = True Then
Label3.Text = TextBox1.Text * 35
Else
If RadioButton4.Checked = True Then
Label3.Text = TextBox1.Text * 25
Else
If RadioButton5.Checked = True Then
Label3.Text = TextBox1.Text * 15
End If
End If
End If
End If
If RadioButton2.Checked = True Then
If RadioButton3.Checked = True Then
Label3.Text = TextBox1.Text * 30
Else
If RadioButton4.Checked = True Then
Label3.Text = TextBox1.Text * 25
Else
If RadioButton5.Checked = True Then
Label3.Text = TextBox1.Text * 20
End If
End If
End If
End If
End Sub
批
2008-03-28 00:19:37
就學的到了=)) 2008-03-28 18:58:01
看起來好複雜= =
還好我沒有學這東西!!!
版主回應
妳沒出國的話就學的到了=)) 2008-03-28 18:58:01
發現還是C比較簡潔有力
=ˇ=