⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 form1.frm

📁 模拟qq 和 fetion的抖动效果
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "模拟QQ窗口抖动"
   ClientHeight    =   2745
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   4170
   LinkTopic       =   "Form1"
   ScaleHeight     =   2745
   ScaleWidth      =   4170
   StartUpPosition =   2  '屏幕中心
   Begin VB.TextBox ty 
      Height          =   405
      Left            =   2280
      TabIndex        =   2
      Text            =   "30"
      Top             =   1800
      Width           =   525
   End
   Begin VB.CommandButton Command2 
      Caption         =   "方法2(推荐)"
      Height          =   1065
      Left            =   2280
      TabIndex        =   1
      Top             =   360
      Width           =   1200
   End
   Begin VB.CommandButton Command1 
      Caption         =   "方法1"
      Height          =   1050
      Left            =   600
      TabIndex        =   0
      Top             =   360
      Width           =   1260
   End
   Begin VB.Label Label1 
      Caption         =   "抖动范围:"
      Height          =   255
      Left            =   1080
      TabIndex        =   3
      Top             =   1920
      Width           =   930
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'wssccc 版权所有
'哇咔咔咔咔~~
'各位加我QQ啊  151884336
'MSN: wssccc@qq.com
'Download:http://www.codefans.net
Option Explicit

Private Sub Command1_Click()
Dim t, L
Dim i, Tt, Ll
t = Me.Top
L = Me.Left
For i = 1 To 200 ' 这个200 可以控制抖动的次数
Tt = Rnd(1) * ty - ty / 2
Ll = Rnd(1) * ty - ty / 2
Me.Top = Me.Top + Tt
Me.Left = Me.Left + Ll
Next

For i = 1 To 200 ' 同上面那个
Tt = Rnd(1) * ty - ty / 2
Ll = Rnd(1) * ty - ty / 2
Me.Top = Me.Top - Tt
Me.Left = Me.Left - Ll
Next

Me.Top = t
Me.Left = L
End Sub

Private Sub Command2_Click()
Dim i
For i = 1 To 200 ' 这个200 也是控制次数
Me.Top = Me.Top + ty
Me.Left = Me.Left + ty
Me.Top = Me.Top - ty
Me.Left = Me.Left - ty
Next
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -