none
vb.net如何让一个FormBorderStyle为None的无边框窗体可改变大小? RRS feed

答案

  • 你好,請參考一下這連結中的文章

    http://www.vbforums.com/showthread.php?568015-Move-and-Resize-a-Control-or-a-Borderless-Form-using-window-messages-(smooth!)&p=3509289#post3509289


    大家一齊探討、學習和研究,謝謝!
    MCSD, MCAD, MCSE+I, MCDBA, MCDST, MCSA, MCTS, MCITP, MCPD,
    MCT, Microsoft Community Star(TW & HK),
    Microsoft MVP for VB.NET since 2003
    My MSMVP Blog

    請記得將對您有幫助的回覆標示為解答以幫助其他尋找解答及參與社群討論的朋友們。
    Please remember to clickMark as Answer on the post that helps you. This can be beneficial to other community members reading the thread.

    2014年11月24日 1:14
  • 你好,

    这个需要重写WndProc()方法。

    Private Const cGrip As Integer = 16
        ' Grip size
        Private Const cCaption As Integer = 32
        ' Caption bar height;
        Protected Overrides Sub WndProc(ByRef m As Message)
            If m.Msg = &H84 Then
                ' Trap WM_NCHITTEST
                Dim pos As New Point(m.LParam.ToInt32() And &HFFFF, m.LParam.ToInt32() >> 16)
                pos = Me.PointToClient(pos)
                If pos.Y < cCaption Then
                    m.Result = IntPtr.op_Explicit(2)
                    ' HTCAPTION
                    Return
                End If
                If pos.X >= Me.ClientSize.Width - cGrip AndAlso pos.Y >= Me.ClientSize.Height - cGrip Then
                    m.Result = IntPtr.op_Explicit(17)
    
                    ' HTBOTTOMRIGHT
                    Return
                End If
            End If
            MyBase.WndProc(m)
        End Sub


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    2014年11月28日 9:00
    版主

全部回复

  • 窗体属性:

    Text = ""
    ControlBox = False
    FormBorderStyle = None

    2014年11月22日 13:37
  • 不行啊。
    2014年11月22日 14:06
  • 你好,請參考一下這連結中的文章

    http://www.vbforums.com/showthread.php?568015-Move-and-Resize-a-Control-or-a-Borderless-Form-using-window-messages-(smooth!)&p=3509289#post3509289


    大家一齊探討、學習和研究,謝謝!
    MCSD, MCAD, MCSE+I, MCDBA, MCDST, MCSA, MCTS, MCITP, MCPD,
    MCT, Microsoft Community Star(TW & HK),
    Microsoft MVP for VB.NET since 2003
    My MSMVP Blog

    請記得將對您有幫助的回覆標示為解答以幫助其他尋找解答及參與社群討論的朋友們。
    Please remember to clickMark as Answer on the post that helps you. This can be beneficial to other community members reading the thread.

    2014年11月24日 1:14
  • 你好,

    这个需要重写WndProc()方法。

    Private Const cGrip As Integer = 16
        ' Grip size
        Private Const cCaption As Integer = 32
        ' Caption bar height;
        Protected Overrides Sub WndProc(ByRef m As Message)
            If m.Msg = &H84 Then
                ' Trap WM_NCHITTEST
                Dim pos As New Point(m.LParam.ToInt32() And &HFFFF, m.LParam.ToInt32() >> 16)
                pos = Me.PointToClient(pos)
                If pos.Y < cCaption Then
                    m.Result = IntPtr.op_Explicit(2)
                    ' HTCAPTION
                    Return
                End If
                If pos.X >= Me.ClientSize.Width - cGrip AndAlso pos.Y >= Me.ClientSize.Height - cGrip Then
                    m.Result = IntPtr.op_Explicit(17)
    
                    ' HTBOTTOMRIGHT
                    Return
                End If
            End If
            MyBase.WndProc(m)
        End Sub


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    2014年11月28日 9:00
    版主