SWP_NOSIZE = 0x0001
SWP_NOMOVE = 0x0002
SWP_NOZORDER = 0x0004
SWP_FRAMECHANGED = 0x0020
SWP_SHOWWINDOW = 0x0040
(GWL_STYLE = (-16
'Window Style
WS_CLIPCHILDREN=0x02000000
WS_CLIPSIBLINGS=0x04000000
hBrush=CreateHatchBrush(HS_DIAGCROSS,ColorTranslator.ToWin32(Color.Red)
,SetWindowSubclass(textBox1.Handle
(AddressOf WindowSubClass,0,0
SetWindowPos(textBox1.Handle,0,0,0, 200,40,SWP_NOZORDER Or SWP_NOMOVE Or
(SWP_SHOWWINDOW Or SWP_FRAMECHANGED
For main form resizing long'
(nStyle = GetWindowLong(this.Handle, GWL_STYLE
SetWindowLong(this.Handle,GWL_STYLE, nStyle And
(WS_CLIPCHILDREN
,WindowSubClass(hWnd,uMsg,wParam
(lParam,uIdSubclass,dwRefData
Select Case uMsg
Case WM_NCPAINT
(hDC=GetWindowDC(hWnd
Dim rct As RECT
()rect = new RECT'
(GetClientRect(hWnd, out rect
rct.right += 20 * 2
rct.bottom += 20 * 2
if hBrush<>0 Then
FillRect hDC,rct,hBrush
ReleaseDC hWnd, hDC
Exit Function
case WM_NCCALCSIZE
if (wParam == (IntPtr)0'
Dim pRect As RECT
,pRect =(RECT)Marshal.PtrToStructure(lParam'
((typeof(RECT'
(Call CopyMemory(VarPtr(rct)+4,ByVal lParam+4,4
pRect.left += 10
pRect.top += 10
pRect.bottom -= 10
pRect.right -= 10
(Marshal.StructureToPtr(pRect, lParam,false'
(Call CopyMemory(lparam,VarPtr(rct),4
Exit Function
End Select
DefSubclassProc(hWnd, uMsg, wParam, lParam)