I would strongly recommend to give up with that. The library
System.Windows.Forms
does not offer such functionality, so you will need to use some elements of raw Windows API.
The problem is solved handling the Windows message
WM_NCPAINT
:
http://msdn.microsoft.com/en-us/library/dd145212%28v=vs.85%29.aspx[
^].
Please see this discussion for some sample solution:
http://social.msdn.microsoft.com/Forums/en-US/netfxbcl/thread/eebf03d0-1242-4fef-857c-5b9e1d38b2f2/[
^].
Again, I do not recommend this trouble. You would pay by loosing compatibility with non-Windows systems. Did you know that you can run your .NET applications using Forms on many other platforms? You will loose this opportunity. More important, you will potentially loose compatibility with future Microsoft systems using SLR. One of Microsoft directions of development leads out of Windows. The Windows features you want to implement using those dirty tricks (legitimate in native Windows, which is going to go obsolete) will hardly be supported in future. Why bothering about them?
—SA