📄 frmcleardbing.frm
字号:
VERSION 5.00
Begin VB.Form frmcleardbing
BorderStyle = 0 'None
Caption = "Form1"
ClientHeight = 2745
ClientLeft = 0
ClientTop = -105
ClientWidth = 6705
LinkTopic = "Form1"
MDIChild = -1 'True
Picture = "frmcleardbing.frx":0000
ScaleHeight = 2745
ScaleWidth = 6705
ShowInTaskbar = 0 'False
Begin VB.Timer mousemovetimer
Enabled = 0 'False
Interval = 10
Left = 960
Top = 2760
End
Begin VB.Timer Timer1
Interval = 10
Left = 1440
Top = 2760
End
Begin VB.Image mousermovepic
Height = 345
Left = 0
Picture = "frmcleardbing.frx":AF0F
Stretch = -1 'True
Top = 0
Width = 6255
End
Begin VB.Image pic_ok
Height = 285
Left = 3720
Picture = "frmcleardbing.frx":FC03
Top = 2085
Visible = 0 'False
Width = 1065
End
Begin VB.Image pic_clearend
Height = 615
Left = 1080
Picture = "frmcleardbing.frx":10C4F
Stretch = -1 'True
Top = 4320
Visible = 0 'False
Width = 615
End
Begin VB.Image pic_close
Height = 180
Left = 6360
Picture = "frmcleardbing.frx":68B63
Top = 120
Width = 180
End
Begin VB.Image Image1
Height = 210
Index = 4
Left = 1980
Picture = "frmcleardbing.frx":68BB5
Stretch = -1 'True
Top = 1560
Width = 15
End
Begin VB.Image Image1
Height = 210
Index = 6
Left = 5880
Picture = "frmcleardbing.frx":68C69
Top = 1560
Width = 75
End
Begin VB.Image Image1
Height = 210
Index = 7
Left = 1920
Picture = "frmcleardbing.frx":68D8B
Top = 1560
Width = 60
End
Begin VB.Image Image1
Height = 210
Index = 0
Left = 2000
Picture = "frmcleardbing.frx":68E77
Stretch = -1 'True
Top = 1560
Width = 3900
End
End
Attribute VB_Name = "frmcleardbing"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim oldx As Integer '为解决全图形窗口没有标题栏而无法拖动的问题而定义的鼠标新旧两个XY变量
Dim oldy As Integer
Dim newx As Integer
Dim newy As Integer
'初始化窗口
Private Sub Form_Load()
Me.Width = 6675
Me.Height = 2730
Me.Top = 1700
Me.Left = 3000
frmmain.clearwindowsishas = True '加载时布尔值为真,这样在再次点击清空按钮或菜单时,不会出现第二个清空窗口“frmcleardb”了
End Sub
'>>>>>>>>>>>>>>>>>>>>>>>>以下程序段解决全图形窗口的移动问题<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
'移植须知:将该功能移植到一个全图片窗口以解决不能移动的问题时,需注意:1 赋值计时器和伪装标题栏到新的全图片窗体中;2 赋值定义的新旧XY值(4个)和本程序段到新的全图片窗体中;3 修改计时器的过程“mousemovetimer_Timer”中的四个窗体名字。4 修改伪装标题栏的图片
'当指定图片(伪装标题栏)被鼠标点击时启动计时器,并记录下当时的初始鼠标坐标
Private Sub mousermovepic_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
mousemovetimer.Enabled = True
oldx = X
oldy = Y
End Sub
'当指定图片(伪装标题栏)上鼠标移动时,赋给新的鼠标XY值,注意系统每隔很短的时间会赋值一次。
Private Sub mousermovepic_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
newx = X
newy = Y
End Sub
'当指定图片(伪装标题栏)被鼠标释放时关闭计时器。
Private Sub mousermovepic_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
mousemovetimer.Enabled = False
End Sub
'计时器将定时得到四个值,分别是固定的初始XY值,和不断变化的新的XY值。利用新旧XY的差,可以以此来移动窗体。适当调小计时器间隔时间将有助于移动窗体的流畅性。
Private Sub mousemovetimer_Timer()
frmcleardbing.Left = frmcleardbing.Left - (oldx - newx)
If frmcleardbing.Top - (oldy - newy) < 1050 Then
frmcleardbing.Top = 1050
Else
frmcleardbing.Top = frmcleardbing.Top - (oldy - newy)
End If
End Sub
'>>>>>>>>>>>>>>>>>>>>>>>>以上程序段解决全图形窗口的移动问题<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
'关闭按钮实现
Private Sub pic_close_Click()
frmmain.clearwindowsishas = False '加载时布尔值为假,这样在再次点击清空按钮或菜单时,会出现清空窗口“frmcleardb”
Unload Me
End Sub
'取消按钮实现
Private Sub pic_exit_Click()
frmmain.clearwindowsishas = False '见上注释
Unload Me
End Sub
'清空后的确定按钮
Private Sub pic_ok_Click()
frmmain.clearwindowsishas = False '见上注释
Unload Me
End Sub
'计时器功能实现
Private Sub Timer1_Timer()
Screen.MousePointer = vbHourglass '鼠标变为沙漏
Image1(4).Width = Image1(4).Width + 40
While Image1(4).Width > 3900
Timer1.Enabled = False
Set Me.Picture = pic_clearend.Picture
pic_ok.Visible = True
Screen.MousePointer = vbDefault '鼠标变回默认
Exit Sub
Wend
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -