像舌头一样从嘴里伸出来,呵呵,一定要这样么? 调整窗体高度不行么? 给你个实现 T 型窗体的例子:Private Type POINTAPI X As Long Y As Long End Type Dim XY() As POINTAPIPrivate Declare Function CreatePolygonRgn Lib "gdi32" (lpPoint As POINTAPI, ByVal nCount As Long, ByVal nPolyFillMode As Long) As Long Private Declare Function SetWindowRgn Lib "user32" (ByVal hWnd As Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long '该例子把窗口变成了一个 T 型: Private Sub Form_Load() Me.ScaleMode = vbPixels End SubPrivate Sub Command1_Click() Dim hRgn As Long Dim lRes As Long ReDim XY(7) As POINTAPI 'T 形需要 8 个点 With Me XY(0).X = 0 XY(0).Y = 0 XY(1).X = .ScaleWidth XY(1).Y = 0 XY(2).X = .ScaleWidth XY(2).Y = .ScaleHeight / 2 XY(3).X = .ScaleWidth - (.ScaleWidth / 3) XY(3).Y = .ScaleHeight / 2 XY(4).X = .ScaleWidth - (.ScaleWidth / 3) XY(4).Y = .ScaleHeight XY(5).X = .ScaleWidth / 3 XY(5).Y = .ScaleHeight XY(6).X = .ScaleWidth / 3 XY(6).Y = .ScaleHeight / 2 XY(7).X = 0 XY(7).Y = .ScaleHeight / 2 End WithhRgn = CreatePolygonRgn(XY(0), 8, 2) lRes = SetWindowRgn(Me.hWnd, hRgn, True) End Sub
调整窗体高度不行么?
给你个实现 T 型窗体的例子:Private Type POINTAPI
X As Long
Y As Long
End Type
Dim XY() As POINTAPIPrivate Declare Function CreatePolygonRgn Lib "gdi32" (lpPoint As POINTAPI, ByVal nCount As Long, ByVal nPolyFillMode As Long) As Long
Private Declare Function SetWindowRgn Lib "user32" (ByVal hWnd As Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long
'该例子把窗口变成了一个 T 型:
Private Sub Form_Load()
Me.ScaleMode = vbPixels
End SubPrivate Sub Command1_Click()
Dim hRgn As Long
Dim lRes As Long
ReDim XY(7) As POINTAPI 'T 形需要 8 个点
With Me
XY(0).X = 0
XY(0).Y = 0
XY(1).X = .ScaleWidth
XY(1).Y = 0
XY(2).X = .ScaleWidth
XY(2).Y = .ScaleHeight / 2
XY(3).X = .ScaleWidth - (.ScaleWidth / 3)
XY(3).Y = .ScaleHeight / 2
XY(4).X = .ScaleWidth - (.ScaleWidth / 3)
XY(4).Y = .ScaleHeight
XY(5).X = .ScaleWidth / 3
XY(5).Y = .ScaleHeight
XY(6).X = .ScaleWidth / 3
XY(6).Y = .ScaleHeight / 2
XY(7).X = 0
XY(7).Y = .ScaleHeight / 2
End WithhRgn = CreatePolygonRgn(XY(0), 8, 2)
lRes = SetWindowRgn(Me.hWnd, hRgn, True)
End Sub