1 Attachment(s)
Move form without Titlebar. no API needed
Easily move form without using titlebar(border style=0) or you can click anywhere on the form to move it!!!.
Code:
Dim xx As Single
Dim yy As Single
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
xx = X
yy = Y
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
With Me
.Left = .Left - (xx - X)
.Top = .Top - (yy - Y)
End With
End If
End Sub
:wave: I found no drawbacks. Do you see anythig? .Please tell me
Re: Move form without Titlebar. no API needed
Quote:
Originally Posted by
nidhin.net
I found no drawbacks. Do you see anythig? .Please tell me
A couple
1. If form scalemode is not Twips, it won't work correctly
2. If user hits Escape key, nothing will happen. Normal behavior during a move is that when Escape is hit, the moving object will snap back to original starting position and dragging stops, even if mouse button is still down.
Re: Move form without Titlebar. no API needed
:)Thanks for your comment.
I am very new to programming. I need the help from experts like you, to become an expert.