问题 填空题

【说明】
在窗体上设计两个文本框和两个标签,标签上显示:“摄氏温度:”和“华氏温度:”,文本框一个用于输入摄氏温度数,一个用于输出对应的华氏温度。摄氏温度与华氏温度的转换公式为:c=(5/9)×(f-32)
要求:对输入的摄氏温度数有检查功能,以拒绝接收非数字字符。运行界面如图所示。


【Visual Basic代码】
Private Sub Commandl_Click ()
Text1 = ""
Text2 = ""
Text1.Enabled = True
Text2.Enabled = True
Text1.SetFocus
End Sub
Private Sub Command2 Click ()
End
End Sub
Private Sub Form Load ()
Text1 = ""
Text2 = ""
Text1.Enabled = False
Text2.Enabled = False
End Sub
Private Sub Textl_Change ()
Text2.Text = (1)
End Sub
Private Sub Textl_KeyPress (KeyAscii As (2) )
If (3) Then
If Chr ( KeyAscii ) < "0" Or (4) Then
(5)
End If
End If
End Sub

答案

参考答案:5 * ( Val ( Text1.Text ) -32 )/9 (2) Integer (3) KeyAscii<>8
(4) Chr(KeyAscii)>"9" (5) KeyAscii=0

单项选择题
单项选择题