ตั้งค่าการอ่าน

ค่าเริ่มต้น

  • เลื่อนอัตโนมัติ
    โค้ดโปรแกรม VB/PHP/JAVA

    ลำดับตอนที่ #2 : [VB] Calculater เครื่องคิดเลข + FILE

    • อัปเดตล่าสุด 14 เม.ย. 61







    ​โ๨้๸๨ำ​นว๷

    Dim num1 As Integer
    Dim num2 As Integer
    Dim result As Integer
    Dim sign As String

    ​โ๨้๸ปุ่ม๹ัว​เล๦ 0-9

    Private Sub Button10_Click()
    If Text1.Text <> "0" Then
    Text1.Text = Text1.Text + "0"
    Else
    Text1.Text = "0"
    End If

    End Sub

    Private Sub Button1_Click()
    If Text1.Text <> "1" Then
    Text1.Text = Text1.Text + "1"
    Else
    Text1.Text = "1"
    End If
    End Sub

    Private Sub Button2_Click()
    If Text1.Text <> "2" Then
    Text1.Text = Text1.Text + "2"
    Else
    Text1.Text = "2"
    End If
    End Sub

    Private Sub Button3_Click()
    If Text1.Text <> "3" Then
    Text1.Text = Text1.Text + "3"
    Else
    Text1.Text = "3"
    End If
    End Sub

    Private Sub Button4_Click()
    If Text1.Text <> "4" Then
    Text1.Text = Text1.Text + "4"
    Else
    Text1.Text = "4"
    End If
    End Sub

    Private Sub Button5_Click()
    If Text1.Text <> "5" Then
    Text1.Text = Text1.Text + "5"
    Else
    Text1.Text = "5"
    End If
    End Sub

    Private Sub Button6_Click()
    If Text1.Text <> "6" Then
    Text1.Text = Text1.Text + "6"
    Else
    Text1.Text = "6"
    End If
    End Sub

    Private Sub Button7_Click()
    If Text1.Text <> "7" Then
    Text1.Text = Text1.Text + "7"
    Else
    Text1.Text = "7"
    End If
    End Sub

    Private Sub Button8_Click()
    If Text1.Text <> "8" Then
    Text1.Text = Text1.Text + "8"
    Else
    Text1.Text = "8"
    End If
    End Sub

    Private Sub Button9_Click()
    If Text1.Text <> "9" Then
    Text1.Text = Text1.Text + "9"
    Else
    Text1.Text = "9"
    End If
    End Sub



    ​โ๨้๸ปุ่ม +,-,*,/

    Private Sub cmdplus_Click()
    num1 = Val(Text1.Text)
    Text1.Text = ""
    sign = "+" 'cmdplus = + '
    End Sub

    Private Sub cmdminus_Click()
    num1 = Val(Text1.Text)
    Text1.Text = ""
    sign = "-" 'cmdminus = - '

    End Sub

    Private Sub cmdmultiply_Click()
    num1 = Val(Text1.Text)
    Text1.Text = ""
    sign = "*" 'cmdmultiply = * '

    End Sub

    Private Sub cmddivide_Click()
    num1 = Val(Text1.Text)
    Text1.Text = ""
    sign = "/" 'cmddivide = / '

    End Sub

    ​โ๨้๸ปุ่ม =

    Private Sub cmdequals_Click()
    num2 = Val(Text1.Text)
    If sign = "+" Then result = num1 + num2
    If sign = "-" Then result = num1 - num2
    If sign = "*" Then result = num1 * num2
    If sign = "/" Then result = num1 / num2
    Text1.Text = Str(result)
    End Sub

    ​โ๨้๸ปุ่ม CE

    Private Sub cmdce_Click()
    Text1.Text = " "
    End Sub


    DOWNLOAD FILE




    ติดตามเรื่องนี้
    เก็บเข้าคอลเล็กชัน

    ผู้อ่านนิยมอ่านต่อ ดูทั้งหมด

    loading
    กำลังโหลด...

    อีบุ๊ก ดูทั้งหมด

    loading
    กำลังโหลด...

    ความคิดเห็น

    ×