计算机类二级VB

二级VB上机题库2

10 题含答案VB
共 10 题返回本类
2材料分析题2 / 10
  
查看答案
Private Sub Form_Click()
    'Picture1.Picture = LoadPicture("")
'或
Picture1 = LoadPicture("")
'或    Picture1.Picture = LoadPicture()
'或    Picture1 = LoadPicture()
End Sub
Private Sub Picture1_Click()
    Picture1.Picture = LoadPicture("pic1.bmp")
'或    Picture1 = LoadPicture("pic1.bmp")
End Sub
3材料分析题3 / 10
  
查看答案
Private Sub Command1_Click()
    If Option1.Item(0) = True Then
        Text2.Text = Format(Sin(Val(Text1.Text) * 3.14159 / 180), "0.000")
    End If
    If Option1.Item(1) = True Then
        Text2.Text = Format(Cos(Val(Text1.Text) * 3.14159 / 180), "0.000")
    End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
    mysub
End Sub
4材料分析题4 / 10
  Private Sub Command1_Click()
'    Timer1.Enabled = ?
End Sub
Private Sub Command2_Click()
    Timer1.Enabled = False
End Sub
Private Sub HScroll1_Change()
'    ? .Interval = HScroll1.Value
End Sub
Private Sub Timer1_Timer()
'    Picture1.Left = ? + 10
End Sub
查看答案
Private Sub Command1_Click()
    Timer1.Enabled = True
End Sub
Private Sub Command2_Click()
    Timer1.Enabled = False
End Sub
Private Sub HScroll1_Change()
    Form1.Timer1.Interval = HScroll1.Value
End Sub
Private Sub Timer1_Timer()
    Picture1.Left = Form1.Picture1.Left + 10
End Sub
5材料分析题5 / 10
  
查看答案
Private Sub Command1_Click()
    Dim f1, f2, f As Long
    Dim a(40) As Long
        f1 = 1
    f2 = 1
    a(1) = f1
    a(2) = f2
    For i = 3 To Val(Text1.Text)
      f = f1 + f2
      a(i) = f
      f1 = f2
      f2 = f
    Next
    Text2.Text = a(40)
End Sub
Private Sub Command2_Click()
    Open App.Path & "\out5.txt" For Output As #1
    Print #1, Text2.Text
    Close #1
End Sub
7材料分析题7 / 10
  
查看答案
Private Sub Command1_Click()
    Text1.SetFocus
End Sub
Private Sub Command2_Click()
    Text2.SetFocus
End Sub
8材料分析题8 / 10
  Private Sub Command1_Click()
'    For k = 0 To ?
        If Option1(k).Value Then
'            n = ?
        End If
    Next k
    Option1(n).Value = False
    n = n + 1
    If n = 4 Then
'        n = ?
    End If
    Option1(n).Value = True
End Sub
查看答案
Private Sub Command1_Click()
    For k = 0 To 3
        If Option1(k).Value Then
            n = k
        End If
    Next k
    Option1(n).Value = False
    n = n + 1
    If n = 4 Then
        n = 0
    End If
    Option1(n).Value = True
End Sub
9材料分析题9 / 10
  Private Sub Command1_Click()
    Dim tmpStr As String * 50
    'Select Case ?
        Case 0
            tmpStr = Left(Trim(Text1.Text), 3)
        Case 1
            tmpStr = Right(Trim(Text1.Text), 3)
        Case 2
            'tmpStr = Mid(Trim(Text1.Text), ? )
    End Select
    'Text2.Text = ?
End Sub
查看答案
Private Sub Command1_Click()
    Dim tmpStr As String * 50
    Select Case Form1.Combo1.ListIndex
        Case 0
            tmpStr = Left(Trim(Text1.Text), 3)
        Case 1
            tmpStr = Right(Trim(Text1.Text), 3)
        Case 2
            tmpStr = Mid(Trim(Text1.Text), 3, 4)
    End Select
    Text2.Text = tmpStr
End Sub
10材料分析题10 / 10
   
查看答案
Dim a(50) As Long
Private Sub Command1_Click()
    Dim f As Long
    a(1) = 1
    a(2) = 1
    For i = 3 To Val(Text1.Text)
      f = a(i - 2) + a(i - 1) + 1
      a(i) = f
    Next
    Text2.Text = f
End Sub
Private Sub Command2_Click()
    Open App.Path & "\out5.txt" For Output As #1
    Print #1, Text2.Text
    Close #1
End Sub
Private Sub Form_Load()
End Sub
← 上一卷下一卷 →