Home All Groups Group Topic Archive Search About

how to move a form that FormBorderStyle is None

Author
19 Apr 2006 2:37 AM
Boki
Dear All,

How to move a form that FormBorderStyle is None?

I want to use mouse drag method..

Best reagrds,
Boki.

Author
19 Apr 2006 2:52 AM
tommaso.gastaldi
see, for instance:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbtskCreatingNon-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:

Show quoteHide quote
> Dear All,
>
> How to move a form that FormBorderStyle is None?
>
> I want to use mouse drag method..
>
> Best reagrds,
> Boki.
Author
19 Apr 2006 5:19 AM
Cor Ligthert [MVP]
Boki,

You mean something as this on our website.

http://www.vb-tips.com/default.aspx?ID=72f58d3f-2cb5-4d51-b148-a2eda88e06ee

I hope this helps,

Cor

Show quoteHide quote
"Boki" <bokit***@ms21.hinet.net> schreef in bericht
news:1145414234.286732.237480@g10g2000cwb.googlegroups.com...
> Dear All,
>
> How to move a form that FormBorderStyle is None?
>
> I want to use mouse drag method..
>
> Best reagrds,
> Boki.
>
Author
19 Apr 2006 10:38 AM
Herfried K. Wagner [MVP]
"Boki" <bokit***@ms21.hinet.net> schrieb:
> How to move a form that FormBorderStyle is None?

<URL:http://www.dotnetrix.co.uk/misc.html>
-> "Move a borderless form."

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>