我因为对窗体有特殊要求,不能把Borderstyle设置成none,只好用api切割
请给出示例。。

解决方案 »

  1.   

    Option ExplicitPrivate Declare Function CreateRectRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
    Private Declare Function SetWindowRgn Lib "user32" (ByVal hWnd As Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long
    Private Sub Command1_Click()
        Dim hRgn As Long
        hRgn = CreateRectRgn(10, 10, 200, 200)
        SetWindowRgn Me.hWnd, hRgn, True
    End Sub自己根据窗体大小调整这四个数字
      

  2.   

    你在需要的时候把窗体的Borderstyle设为0就行了。。