how to move a form that FormBorderStyle is None

B

Boki

Dear All,

How to move a form that FormBorderStyle is None?

I want to use mouse drag method..

Best reagrds,
Boki.
 
T

tommaso.gastaldi

see, for instance:

http://msdn.microsoft.com/library/d...tskCreatingNon-StandardShapedWindowsForms.asp

' Visual Basic
Private Sub Form1_MouseDown(ByVal sender As Object, _
ByVal e As MouseEventArgs) Handles MyBase.MouseDown
Dim xOffset As Integer
Dim yOffset As Integer

If e.Button = MouseButtons.Left Then
xOffset = -e.X - SystemInformation.FrameBorderSize.Width
yOffset = -e.Y - SystemInformation.CaptionHeight - _
SystemInformation.FrameBorderSize.Height
mouseOffset = New Point(xOffset, yOffset)
isMouseDown = True
End If
End Sub

-tom


Boki ha scritto:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top