2019年5月28日 星期二

Bread麵包配方--程式碼示範



Public Class Form1
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim percentage, Baking As Single
        TextBox17.Text = Val(TextBox1.Text) + Val(TextBox2.Text) + Val(TextBox3.Text) + Val(TextBox4.Text) + Val(TextBox5.Text) + Val(TextBox6.Text) + Val(TextBox7.Text)
        Baking = ((Val(TextBox15.Text) * Val(TextBox16.Text)) / Val(TextBox17.Text)) / 0.95
        TextBox18.Text = Baking
        TextBox8.Text = Int(Val(TextBox1.Text) * Baking)
        TextBox9.Text = Int(Val(TextBox2.Text) * Baking)
        TextBox10.Text = Int(Val(TextBox3.Text) * Baking)
        TextBox11.Text = Int(Val(TextBox4.Text) * Baking)
        TextBox12.Text = Int(Val(TextBox5.Text) * Baking)
        TextBox13.Text = Int(Val(TextBox6.Text) * Baking)
        TextBox14.Text = Int(Val(TextBox7.Text) * Baking)
    End Sub
End Class

沒有留言:

張貼留言