跪求海陆空各路vb高手,这道题是期末考试题,我的未来就靠你们了

来源:百度知道 编辑:UC知道 时间:2024/06/20 13:20:17
通过键盘输入10个数,保存在数组当中,当按下“a”时,在文本框中输出10个数中的最大值;当按下控制键“F4”时,在文本框中输出10个数中的最小值。
请将编程过程详细写出,生死攸关,菜鸟勿扰。

'新建窗体,添加command1,text1,复制粘贴下段代码
Dim max As Double, min As Double '定义max存储最大数,min存储最小数
Private Sub Command1_Click()
Dim a(10) As Double '定义数组
On Error Resume Next '出错继续
Me.KeyPreview = True '设置窗体接受
For i = 0 To 9 '循环为数组赋值
a(i) = InputBox("第" & i + 1 & "个数:")
If max < a(i) Then max = a(i) '存储最大数
If min > a(i) Then min = a(i) '存储最小数
Next
End Sub
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 65 Then Text1.Text = "最大数为 " & max '按下a
If KeyCode = 115 Then Text1.Text = "最小数为 " & min '按下F4
End Sub

Dim a(10) As Double
Private Sub Form_Load()

Dim i As Integer
For i = 0 To 9
a(i) = InputBox("请输入第" & i + 1 & "个数")
Next i
End Sub
Private Sub getMin()
Dim temp As Double
For i = 0 To 9
If