【VB开源代码栏目提醒】:网学会员为广大网友收集整理了,Window.frm,希望对大家有所帮助!
VERSION 5.00
Begin VB.Form Window
Caption = "动态窗体"
ClientHeight = 3195
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 3195
ScaleWidth = 4680
StartUpPosition = 3 '窗口缺省
End
Attribute VB_Name = "Window"
Attribute
VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim oldColor As Long '保存原来的窗体颜色
Private Sub Form_Click()
End
End Sub
Private Sub Form_Load()
Window.Width = 3000
Window.Height = 2000
oldColor = Window.BackColor
End Sub
'鼠标移动到窗体则窗体颜色变为蓝色且窗体变大反之则变回原来的窗体
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Window.Width = 6000
Window.Height = 3000
Window.BackColor = RGB(0, 0, 255)
If (X > 5000) Or (Y > 2000) Or (X < 200) Or (Y < 200) Then
Window.Width = 3000
Window.Height = 2000
Window.BackColor = oldColor
End If
End Sub