This article demonstrates how to use the API to cut and restore the form header bar, and demonstrate the dynamic addition method of the control:
'This sample show you how to cut the caption title exactly and create controls with code.'add a new form, do nothing but copy this codes for it.Option Explicit Private 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 Declare Function GetSystemMetrics Lib "user32" (BYVAL NINDEX AS Long) As long