'添加一个Label控件,作为右下角的标记'Tcmcz制作 Private Sub Form_Load() With Label1 .Caption = "" .BackColor = RGB(0, 0, 255) '如觉得右下角这个点不好看,可改为:.BackStyle = 0 .Height = 100 .Width = 100 .Left = Me.ScaleWidth - 100 .Top = Me.ScaleHeight - 100 .MousePointer = 8 End WithEnd Sub Private Sub Label1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) Static OldX, OldY As Single OldX = X: OldY = YEnd Sub Private Sub Label1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single) PianyiX = X - OldX: PianyiY = Y - OldY Label1.Left = Label1.Left + PianyiX Label1.Top = Label1.Top + PianyiY Me.Width = Me.Width + PianyiX Me.Height = Me.Height + PianyiYEnd Sub

评论