整人程序源码(VB)

整人程序源码(VB)_第1张图片
整人程序源码(VB)_第2张图片

程序采用了VB6.0编写,Form1.frm 窗体代码如下:

VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "你是煞笔吗?"
   ClientHeight    =   3135
   ClientLeft      =   60
   ClientTop       =   405
   ClientWidth     =   4680
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   3135
   ScaleWidth      =   4680
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton Command2 
      Caption         =   "否"
      Height          =   375
      Left            =   2520
      TabIndex        =   1
      Top             =   2400
      Width           =   1335
   End
   Begin VB.CommandButton Command1 
      Caption         =   "是"
      Height          =   375
      Left            =   480
      TabIndex        =   0
      Top             =   2400
      Width           =   1335
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

Public s As Long


Private Sub Command1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If s > 3 Then
        Command1.Caption = "是"
        Command2.Caption = "否"
    End If
End Sub

Private Sub Command2_Click()
    If Command2.Caption = "是" Then
       MsgBox ("恭喜,回答正确")
       Unload Me
    Else
       MsgBox ("回答错误")
    End If
End Sub

Private Sub Command1_Click()
    If Command1.Caption = "是" Then
       MsgBox ("恭喜,回答正确")
       Unload Me
    Else
       MsgBox ("回答错误")
    End If
End Sub



Private Sub Command2_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)

    Dim i As Integer
    If s = 0 Then
        For i = 1 To 5
            Command2.Top = Command2.Top - 150
            Sleep 5
        Next
        s = s + 1

        Exit Sub

    End If

    If s = 1 Then
        For i = 1 To 5
            Command2.Top = Command2.Top + 150
            Sleep 5
        Next
        s = s + 1
        Exit Sub
    End If

    If s = 2 Then
        For i = 1 To 5
            Command2.Top = Command2.Top - 150
            Sleep 5
        Next
        s = s + 1
        Exit Sub
    End If

    If s = 3 Then
        For i = 1 To 5
            Command2.Top = Command2.Top + 150
            Sleep 5
        Next
        s = s + 1
        Exit Sub
    End If


    Command1.Caption = "否"
    Command2.Caption = "是"
End Sub

Private Sub Form_Unload(Cancel As Integer)
Cancel = -1
End Sub

预编译程序下载(下载后务必自行用反病毒程序扫描确认安全):

链接: https://pan.baidu.com/s/19K_iA7XvDch0tyOOl7TM8Q 密码: nnv9

你可能感兴趣的:(vb)