緊急求救歐~~VB~~ 會的人進來幫幫忙
急救!! =VB高手請來幫一下=
小弟我現在要寫一個程式
這程式是 輸入3的數值
他會在
lblDisplay1 秀出 3個數的總合
lblDisplay2 秀出 3個數的平均值
lblDisplay3 秀出 3個數的成績
lblDisplay4 秀出 3個數中的最小的那個數字秀出來
lblDisplay5 秀出 3個數中的最大的那個數字秀出來
拜託各位高手幫小弟我完成一下
我已經快風掉啦QQ
這是我程式的原始碼
------------------------------------------------------------
Option Explicit
Private Sub cmdEnterNumbers_Click()
Dim num1 As Integer, num2 As Integer, num3 As Integer
lblDisplay1.Caption = ""
lblDisplay2.Caption = ""
lblDisplay3.Caption = ""
lblDisplay4.Caption = ""
num1 = InputBox("Enter first integer", "Input")
num2 = InputBox("Enter second integer", "Input")
num3 = InputBox("Enter third integer", "Input")
If num1 + num2 + num3 Then
lblDisplay1.Caption = "The sum is " & num1 + num2 + num3
End If
If (num1 + num2 + num3) / 3 Then
lblDisplay2.Caption = "The average is " & (num1 + num2 + num3) / 3
End If
If num1 * num2 * num3 Then
lblDisplay3.Caption = "The product is " & num1 * num2 * num3
End If
End Sub
arrow
arrow
    全站熱搜

    vbqa 發表在 痞客邦 留言(2) 人氣()