【VB开源代码栏目提醒】:以下是网学会员为您推荐的VB开源代码-你依然爱我吗?.frm,希望本篇文章对您学习有所帮助。
VERSION 5.00
Begin VB.Form Form1
BorderStyle = 0 'None
Caption = "求爱游戏"
ClientHeight = 6705
ClientLeft = 0
ClientTop = 0
ClientWidth = 9510
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
Picture = "你依然爱我吗?.frx":0000
ScaleHeight = 6705
ScaleWidth = 9510
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Begin VB.Timer Timer3
Enabled = 0 'False
Interval = 200
Left = 1080
Top = 90
End
Begin VB.Timer Timer2
Interval = 200
Left = 120
Top = 120
End
Begin VB.Timer Timer1
Enabled = 0 'False
Interval = 1000
Left = 585
Top = 90
End
Begin VB.Image Image7
Height = 4800
Left = 4815
Picture = "你依然爱我吗?.frx":30A7
Top = 0
Visible = 0 'False
Width = 4800
End
Begin VB.Image Image6
Height = 1500
Left = 2925
Picture = "你依然爱我吗?.frx":4E0EB
Top = 4905
Visible = 0 'False
Width = 1620
End
Begin VB.Image Image5
Height = 1500
Left = 1260
Picture = "你依然爱我吗?.frx":4E9D3
Top = 4905
Visible = 0 'False
Width = 1620
End
Begin
VB.Image Image4
Height = 870
Left = 90
Picture = "你依然爱我吗?.frx":4F955
Top = 5760
Visible = 0 'False
Width = 1110
End
Begin VB.Image Image3
Height = 870
Left = 90
Picture = "你依然爱我吗?.frx":4FEBD
Top = 4905
Visible = 0 'False
Width = 1110
End
Begin VB.Image Image2
Height = 1500
Left = 1920
Top = 1920
Width = 1620
End
Begin VB.Image Image1
Height = 870
Left = 1890
Top = 765
Width = 1110
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim 时间 As Byte
Dim ddd As Boolean
Dim ra As Byte
Dim tt As Byte
Private Const SWP_NOSIZE = &H1
Private Const SWP_NOMOVE = &H2
Private Const SWP_NOZORDER = &H4
Private Const SWP_NOREDRAW = &H8
Private Const SWP_NOACTIVATE = &H10
Private Const SWP_FRAMECHANGED = &H20
Private Const SWP_SHOWWINDOW = &H40
Private Const SWP_NOCOPYBITS = &H80
Private Const SWP_NOOWNERZORDER = &H200
Private Const SWP_DRAWFRAME = SWP_FRAMECHANGED
Private Const SWP_NOREPOSITION = SWP_NOOWNERZORDER
Private Const HWND_TOP = 0
Private Const HWND_BOTTOM = 1
Private Const HWND_TOPMOST = -1
Private Const HWND_NOTOPMOST = -2
Private Declare Function SetWindowPos Lib "user32" (ByVal hWnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Private mbOnTop As Boolean
Private Property Let OnTop(Setting As Boolean)
If Setting Then
SetWindowPos hWnd, -1, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE
Else
SetWindowPos hWnd, -2, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE
End If
mbOnTop = Setting
End Property
Private Property Get OnTop() As Boolean
OnTop = mbOnTop
End Property
Private Sub Command2_Click()
End Sub
Private Sub Image1_Click()
Randomize Timer
ra = Int(Rnd * 10) + 1
Form1.Hide
Timer1.Enabled = True
End Sub
Private Sub Image2_Click()
Form1.Picture = Image7.Picture
Image2.Visible = False
Image1.Visible = False
Timer3.Enabled = True
End Sub
Private Sub Timer1_Timer()
时间 = 时间 + 1
If 时间 > ra Then
Form1.Show
OnTop = True
时间 = 0
Timer1.Enabled = False
End If
End Sub
Private Sub Form_Load()
Dim n As Long, rgn1 As Long, rgn2 As Long
Dim Ma As Dat
Show
Open App.Path & "\Ma.dat" For Random As #1 Len = Len(Ma)
Do While Not EOF(1)
n = n + 1
Get #1, n, Ma
If rgn1 = 0 Then rgn1 = CreateRectRgn(Ma.sx, Ma.sy, Ma.ex, Ma.ey)
If rgn1 <> 0 Then
rgn2 = CreateRectRgn(Ma.sx, Ma.sy, Ma.ex, Ma.ey)
CombineRgn rgn1, rgn1, rgn2, 2
DeleteObject rgn2
End If
Loop
Close #1
SetWindowRgn hWnd, rgn1, True
DeleteObject rgn1
OnTop = True
End Sub
Private Sub Timer2_Timer()
If ddd = False Then
Image1.Picture = Image3.Picture
Image2.Picture = Image6.Picture
Else
Image1.Picture = Image4.Picture
Image2.Picture = Image5.Picture
End If
ddd = Not ddd
End Sub
Private Sub Timer3_Timer()
tt = tt + 1
If tt > 50 Then Unload Me
End Sub