VERSION 5.00 Begin VB.Form Form1 Caption = "Form1" ClientHeight = 5565 ClientLeft = 60 ClientTop = 450 ClientWidth = 7515 LinkTopic = "Form1" ScaleHeight = 5565 ScaleWidth = 7515 StartUpPosition = 3 '窗口缺省 Begin VB.PictureBox Picture1 Height = 4935 Left = 165 ScaleHeight = 4875 ScaleWidth = 6600 TabIndex = 0 Top = 135 Width = 6660 Begin VB.Label Labk BackColor = &H00000000& Height = 180 Index = 1 Left = 3525 TabIndex = 2 Top = 1425 Width = 225 End Begin VB.Label Labk BackColor = &H00000000& Height = 180 Index = 0 Left = 1095 TabIndex = 1 Top = 2835 Width = 210 End Begin VB.Shape Shape1 Height = 2025 Left = 555 Top = 450 Width = 2670 End 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 leftdowny As Boolean Dim mcleft As Integer, mctop As Integer Private Sub Labk_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single) leftdowny = True mcleft = X mctop = Y End SubPrivate Sub Labk_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single) If leftdowny = False Then Exit Sub Select Case Index Case 0 '下 Labk(Index).Top = Labk(Index).Top + Y - mctop Shape1.Height = Labk(Index).Top - Shape1.Top Case 1 '右 Labk(Index).Left = Labk(Index).Left + X - mcleft Shape1.Width = Labk(Index).Left - Shape1.Left End Select End SubPrivate Sub Labk_MouseUp(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single) leftdowny = False End Sub
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 5565
ClientLeft = 60
ClientTop = 450
ClientWidth = 7515
LinkTopic = "Form1"
ScaleHeight = 5565
ScaleWidth = 7515
StartUpPosition = 3 '窗口缺省
Begin VB.PictureBox Picture1
Height = 4935
Left = 165
ScaleHeight = 4875
ScaleWidth = 6600
TabIndex = 0
Top = 135
Width = 6660
Begin VB.Label Labk
BackColor = &H00000000&
Height = 180
Index = 1
Left = 3525
TabIndex = 2
Top = 1425
Width = 225
End
Begin VB.Label Labk
BackColor = &H00000000&
Height = 180
Index = 0
Left = 1095
TabIndex = 1
Top = 2835
Width = 210
End
Begin VB.Shape Shape1
Height = 2025
Left = 555
Top = 450
Width = 2670
End
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 leftdowny As Boolean
Dim mcleft As Integer, mctop As Integer
Private Sub Labk_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
leftdowny = True
mcleft = X
mctop = Y
End SubPrivate Sub Labk_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
If leftdowny = False Then Exit Sub
Select Case Index
Case 0 '下
Labk(Index).Top = Labk(Index).Top + Y - mctop
Shape1.Height = Labk(Index).Top - Shape1.Top
Case 1 '右
Labk(Index).Left = Labk(Index).Left + X - mcleft
Shape1.Width = Labk(Index).Left - Shape1.Left
End Select
End SubPrivate Sub Labk_MouseUp(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
leftdowny = False
End Sub