2017年10月13日 星期五

VB2010 四則運算



Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim A, B, C As Double
        A = Val(TextBox1.Text)
        B = Val(TextBox2.Text)
        C = A + B
        TextBox3.Text = C.ToString
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Dim A, B, C As Double
        A = Val(TextBox1.Text)
        B = Val(TextBox2.Text)
        C = A - B
        TextBox3.Text = C.ToString
    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        Dim A, B, C As Double
        A = Val(TextBox1.Text)
        B = Val(TextBox2.Text)
        C = A * B
        TextBox3.Text = C.ToString
    End Sub

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        Dim A, B, C As Double
        A = Val(TextBox1.Text)
        B = Val(TextBox2.Text)
        C = A / B
        TextBox3.Text = C.ToString
    End Sub
End Class

沒有留言:

張貼留言

2024年4月24日 星期三 Node-Red Dashboard UI Template + AngularJS 參考 AngularJS教學 --2

 2024年4月24日 星期三 Node-Red Dashboard UI Template + AngularJS 參考 AngularJS教學 --2 AngularJS 實例 <!DOCTYPE html> <html> <head> &...