正在加载图片...
Text2 SetFocus: MsgBox("分数错") End lf End If End sub C) Private Sub Textl Key Press(Key Ascii As Integer) If KeyAscii= 13 Then 车符的ASCI码是13 If a <o and a> 100 then Else TextI. SetFocus: MsgBox("分数错") End If End if End Sub D) Private Sub Textl Key Press(Key Ascii As Integer) If KeyAscii= 13 Then 车符的ASCI码是13 a= val(Text1) If a >=0 And a < 100 Then Text2 SetFocus Else Textl. SetFocus: Msg Box("分数错") End sub (35)在窗体上画2个命令按钮,名称分别为 Commandl、 Command2,然后编写下列事件 过程 Const n=5. m=4 Dim Private Sub Commandl Click() For i= 1 To m Next I End sub Private Sub Command2 Click( For i=l To m Else 二级 Visual basic语言程序设计试卷第8页(共11页)二级 Visual Basic 语言程序设计试卷 第 8 页(共 11 页) Text2.SetFocus:MsgBox ("分数错") End If End If End Sub C)Private Sub Text1_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then '回车符的 ASCII 码是 13 a = Val(Text1) If a < 0 And a > 100 Then Text2.SetFocus Else Text1.SetFocus : MsgBox ("分数错") End If End If End Sub D)Private Sub Text1_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then '回车符的 ASCII 码是 13 a = Val(Text1) If a >= 0 And a <= 100 Then Text2.SetFocus Else Text1.SetFocus:MsgBox ("分数错") End If End If End Sub (35)在窗体上画 2 个命令按钮,名称分别为 Command1、Command2,然后编写下列事件 过程。 Const n = 5, m=4 Dim a(m, n) Private Sub Command1_Click( ) k=1 For i= 1 To m For j = 1 To n a(i,j) =k k=k+1 Next j Next i End Sub Private Sub Command2_Click( ) summ = 0 For i= 1 To m For j = 1 To n If i = 1 Or i = m Then summ = summ + a(i, j) Else
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有