I need some help to handle the Region property of my Form in the correct
way.
Usually when I create shaped forms in my programs, I modify the Form.Region
property, making it include only a part of the form client rectangle (I use
a custom button to close my form).
The problem is that when I want to go back to a normal shaped form at
runtime, I use the following line of code:
this.Region=new System.Drawing.Region(new
System.Drawing.Rectangle(0,0,this.Width,this.Heigh t));
This line works, but creates an old fashioned flat titlebar, not a XP style
titlebar.
This effect is very easily observable: just put the line above at the end of
a Form constructor and run the program.
I tried with Application.EnableVisualStyles(), but it doesn't seem to work.
The Form class doesn't have a FlatStyle property to be set to System.
Any help is welcome. Thank you in advance.