计算机类二级VB

二级VB上机题库23

10 题含答案VB
共 10 题返回本类
2材料分析题2 / 10
  
查看答案
Private Sub Dir1_Change()
'    File1.Path = Dir1.Path
    Form1.File1.Path = Form1.Dir1
End Sub
Private Sub Drive1_Change()
'    Dir1.Path = Drive1.Drive
    Dir1 = Me.Drive1
End Sub
Private Sub File1_Click()
'    Label2.Caption = File1.FileName
    Label2 = File1.FileName
End Sub
'Private Sub File1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
'    Label2.Caption = File1.FileName
'End Sub
Private Sub Form_Load()
End Sub
3材料分析题3 / 10
   
Private Sub Command1_Click()
    'Combo1.?
    Text1.Text = ""
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
    'If KeyAscii > 57 Or KeyAscii < ? Then
        MsgBox "请输入数字!"
    '    KeyAscii = ?
    End If
End Sub
查看答案
Private Sub Command1_Click()
    Combo1.AddItem Text1.Text
    Text1.Text = ""
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
    If KeyAscii > 57 Or KeyAscii < 48 Then
        MsgBox "请输入数字!"
        KeyAscii = 0
    End If
End Sub
4材料分析题4 / 10
   
Private Sub Command1_Click()
    Dim m As Integer
    Dim n As Integer
    Dim s As Long
    Dim i As Integer
    m = Val(Text1.Text)
    n = Val(Text2.Text)
    s = 0
    'For i = ?  To n
        't = ?
        's = s + ?
    Next
    lblResult.Caption = s
End Sub
Private Function f(ByRef x As Integer) As Long
    Dim t As Long
    t = 1
    For i = 1 To x
        't = ?
    Next
    'f = ?
End Function
查看答案
For i = m To n
        t = f(i)
        s = s + t
        t = t * i
    f = t
5材料分析题5 / 10
   
Private Sub Command1_Click()
    '===考生编写程序开始====
       
    '===考生编写程序结束====
       
    '不要改动以下内容
    save Label1
End Sub
查看答案
    n = 0
    For i = 1 To 60
        For j = 1 To 60
            For k = 1 To 60
                x = k * k
                If (x = i * i + j * j) And j > i Then
                    Print i; j; k
                    n = n + 1
                End If
            Next k
        Next j
    Next i
    Label1.Caption = n
7材料分析题7 / 10
  
查看答案
Private Sub Command1_Click()
    Shape1.Shape = 3
End Sub
Private Sub Command2_Click()
    Shape1.BorderColor = &HFF&
End Sub
8材料分析题8 / 10
   
Private Sub mnuOper_Click(Index As Integer)
    'Select Case ?
        Case 1
            Form2.Show
            Form1.Hide
        Case 2
    '      Timer1.Enabled =?
        Case 3
            End
    End Select
End Sub
Private Sub Timer1_Timer()
    Picture1.Left = Picture1.Left + 100
    'If Picture1.Left + Picture1.Width >= ? Then
        'Picture1.Left = ?
    End If
End Sub
Private Sub Command1_Click()
    Form1.Show
    Form2.Hide
End Sub
查看答案
    Select Case Index
            Timer1.Enabled = True
    If Picture1.Left + Picture1.Width >= Width Then
        Picture1.Left = 0
9材料分析题9 / 10
   
Private Sub Check1_Click()
    If Check1.Value = 1 Then
        Frame1.Enabled = True
    Else
        Frame1.Enabled = False
    End If
End Sub
Private Sub Check2_Click()
    If Check2.Value = 1 Then
        Frame2.Enabled = True
    Else
        Frame2.Enabled = False
    End If
End Sub
Private Sub Command1_Click()
    If Check1.Value = 1 Then
        'If  ? = True Then
            s = "古典音乐"
        Else
            s = "流行音乐"
        End If
    End If
    If Check2.Value = 1 Then
        'If ? = True Then
            s = s & "篮球"
        Else
            s = s & "羽毛球"
        End If
    End If
    'Label2.Caption = ?
End Sub
Private Sub Form_Load()
    Check1.Value = 1
    Check2.Value = 1
End Sub
查看答案
'        If Option1.Item(0) = True Then或If Option1(0).Value = True Then
        If Option2.Value = True Then
    Label2.Caption = s
10材料分析题10 / 10
   
Option Base 1
Dim a(4, 4) As Integer
Private Sub Command1_Click()
'====考生编写程序开始====
  (1)
    '====考生编写程序结束====
    '不得修改以下部分
    save Label3
End Sub
Private Sub Command2_Click()
'====考生编写程序开始====
(2)
    '====考生编写程序结束====
    '不得修改以下部分
    save Label4
End Sub
Private Sub Form_Load()
    Open App.Path & "\in5.txt" For Input As #1
    For i = 1 To 4
        For j = 1 To 4
            Input #1, a(i, j)
        Next j
    Next i
    Close #1
End Sub
查看答案
  (1)  Max = a(1, 1)
    For i = 1 To 4
        For j = 1 To 4
            If a(i, j) > Max Then
                Max = a(i, j)
            End If
        Next j
    Next i
Label3.Caption = Max
(2)    Sum = 0
    For i = 1 To 4
        Sum = Sum + a(i, i)
    Next i
    Label4.Caption = Sum
← 上一卷下一卷 →