1、【
简答题】
[10分]
解析:
Private Sub C1_Click()
Form1.Visible = False
End Sub
Private Sub C2_Click()
Form1.Visible = True
End Sub
2、【
简答题】
[10分]
解析:
Private Sub Timer1_Timer()
'Form1.L1 = Timer1.Parent.L1 + 1
L1 = L1 + 1
End Sub
3、【
简答题】
'提供给考生的程序
Private Sub Form_Unload(Cancel As Integer)
Open App.Path & "\out5.txt" For Output As #1
Print #1, Op1.Value, Op2.Value, Text1.Text
Close #1
End Sub
[10分]
解析:
'要求考生编写的程序
Private Sub C1_Click()
If Op1.Value Then
Text1.Text = fun(7)
End If
If Op2.Value Then
Text1.Text = fun(3)
End If
End Sub
Private Function fun(a As Integer) As Integer
s% = 0
For i% = 500 To 600
If Int(i% / a) = i% / a Then
s% = s% + i%
End If
Next
fun = s%
End Function
4、【
简答题】
[10分]
解析:
Private Sub C1_Click()
Open "in5.txt" For Input As #1
Input #1, a$
Text1.Text = a$
Close #1
End Sub
Private Sub C2_Click()
a$ = Text1.Text
b$ = ""
n = Len(a$)
For i = 1 To n
b$ = b$ + UCase$(Mid$(a$, i, 1))
Next
Text1.Text = b$
End Sub
Private Sub C3_Click()
Open "out5.txt" For Output As #1
Print #1, Text1.Text
Close #1
End Sub
5、【
简答题】
[10分]
解析:
按要求解答即可
6、【
简答题】
[10分]
解析:
Private Sub C1_Click()
Me.Text1.Font.Name = "宋体"
End Sub
7、【
简答题】
[10分]
解析:
按要求解答即可
8、【
简答题】
Private Sub C1_Click()
'题目
For i = 0 To Me.l1.ListCount - 1
If l1.Selected(i) = True Then
Print l1.List(i)
End If
Next
End Sub
[10分]
解析:
'答案
'0
'4 或 L1.ListCount-1
'Selected(i)
9、【
简答题】
Private Sub C1_Click()
'题目:
' If HS1.Value + Text1.Text > HS1.? Then
' MsgBox "文本框中的数值太大"
' ElseIf HS1.Value + Text1.Text < ? Then
' MsgBox "文本框中的数值太小"
' Else
' ? = HS1.Value + Text1.Text
' End If
[10分]
解析:
'正确程序
If HS1.Value + Text1.Text > HS1.Max Then
MsgBox "文本框中的数值太大"
ElseIf HS1.Value + Text1.Text < HS1.Min Then
MsgBox "文本框中的数值太小"
Else
HS1.Value = HS1.Value + Text1.Text
End If
End Sub
'答案
'Max 或 100
'HS1.Min 或 1
'HS1.Value
10、【
简答题】
[10分]
解析:
Private Sub Form_DblClick()
P1.Picture = LoadPicture()
'或 P1.Picture = LoadPicture("")
End Sub