二级VB上机题库17

时长:120分钟 总分:100分

55浏览 0人已完成答题

题型介绍
题型 简答题
数量 10
第33套
一、基本操作题
1.
  
问题详情
2.
  
问题详情
二、简单应用题
3.
  Dim a(100) As Integer
Private Sub Command1_Click()
    Dim k As Integer
    Open App.Path & "\in3.dat" For Input As #1
    For k = 1 To 100
        Input #1, a(k)
    Next k
    Close #1
End Sub
Private Sub Command2_Click()
  '需考生编写
问题详情
4.
  
问题详情
三、综合应用题
5.
   
Dim which As Integer
Private Sub copy_Click()
    If which = 1 Then
        Text3.Text = Text1.Text
    ElseIf which = 2 Then
        Text3.Text = Text2.Text
    End If
End Sub
Private Sub cut_Click()
    If which = 1 Then
        Text3.Text = Text1.Text
        Text1.Text = ""
    ElseIf which = 2 Then
        Text3.Text = Text2.Text
        Text2.Text = ""
    End If
End Sub
Private Sub edit_Click()
'    If which = ? Then
        If Text1.Text = "" Then
            cut.Enabled = False
            copy.Enabled = False
        Else
            cut.Enabled = True
            copy.Enabled = True
        End If
'    ElseIf which = ? Then
        If Text2.Text = "" Then
            cut.Enabled = False
            copy.Enabled = False
        Else
            cut.Enabled = True
            copy.Enabled = True
        End If
    End If
    If Text3.Text = "" Then
        paste.Enabled = False
    Else
        paste.Enabled = True
    End If
End Sub
Private Sub paste_Click()
    If which = 1 Then
'        Text1.Text = ?
    ElseIf which = 2 Then
'        Text2.Text = ?
    End If
End Sub
Private Sub Text1_GotFocus()  '本过程的作用是:当焦点在Text1中时,which = 1
    which = 1
End Sub
Private Sub Text2_GotFocus()  '本过程的作用是:当焦点在Text2中时,which = 2
    which = 2
End Sub
问题详情
第34套
一、基本操作题
6.
  
问题详情
7.
  
问题详情
二、简单应用题
8.
  
问题详情
9.
  
问题详情
三、综合应用题
10.
   
Dim a(15) As String
Private Sub C1_Click()
    Dim k As Integer
    Open "in5.txt" For Input As #1
    Form1.Cls
    For k = 1 To 15
        Input #1, a(k)
        Print a(k)
    Next k
'    Close ?
End Sub
Private Sub C2_Click()
    Dim k As Integer, n As Integer, c As String
'    n = Len( ? )
    c = ""
    If n > 0 Then
        For k = 1 To 15
'            If Left(a(k), ? ) = Text1.Text Then
'                c = c + "  " + ?
            End If
        Next k
        If c = "" Then
            Text2.Text = "未找到!"
        Else
'            Text2.Text = ?
        End If
    Else
        Text2.Text = "未输入查找内容!"
    End If
End Sub
问题详情