在设计阶段,将窗体的BorderStyle设置为0,ShowInTaskbar设置为True就可以了。移动窗体的代码如下: Dim MoveScreen As Boolean Dim MousX As Integer Dim MousY As Integer Dim CurrX As Integer Dim CurrY As Integer Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) If Button = 1 Then MoveScreen = True MousX = X MousY = Y End If End Sub Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) If MoveScreen Then CurrX = Form1.Left - MousX + X CurrY = Form1.Top - MousY + Y Form1.Move CurrX, CurrY End If End Sub Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single) MoveScreen = False End Sub |
|