程序大框架: Imports System.Runtime.InteropServices Public Structure MARGINS Public cxLeftWidth As Integer Public cxRightWidth As Integer Public cyTopHeight As Integer Public cyBottomHeight As Integer End Structure Public Class Form1 Const WM_NCHITTEST As Integer = &H84 Const HTCLIENT As Integer = &H1 Const HTCAPTION As Integer = &H2 Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message) Select Case m.Msg Case WM_NCHITTEST MyBase.WndProc(m) If m.Result = HTCLIENT Then m.Result = HTCAPTION Case Else MyBase.WndProc(m) End Select End Sub _ Private Shared Function DwmExtendFrameIntoClientArea(ByVal hwnd As IntPtr, ByRef margins As MARGINS) As Integer End Function Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim margins As MARGINS = New MARGINS margins.cxLeftWidth = -1 margins.cxRightWidth = -1 margins.cyTopHeight = -1 margins.cyBottomHeight = -1 Dim hwnd As IntPtr = Me.Handle Dim r