Regions and Windows XP

  • Thread starter Thread starter Pieler Aaron
  • Start date Start date
P

Pieler Aaron

I am creating a simple Windows Application with an empty Form.

The constructor of the Form has following lines:
InitializeComponent();
Region region = new Region();
region.Exclude ( new Rectangle(100,100,50,50));
this.Region = region;

If this Form is displayed in Windows XP (XP-Themes enabled) then the
Titlebar has not the XP-like blue color. Also the blue border is gone.

Has someone an idea what I can do about that?
 
Pieler Aaron said:
I am creating a simple Windows Application with an empty Form.

The constructor of the Form has following lines:
InitializeComponent();
Region region = new Region();
region.Exclude ( new Rectangle(100,100,50,50));
this.Region = region;

If this Form is displayed in Windows XP (XP-Themes enabled) then the
Titlebar has not the XP-like blue color. Also the blue border is gone.

This behavior is by design. Theming of the non-client area gets disabled
automatically for forms with a custom region. Are you attempting to enable
theming for the non-client area or do you just want to disable the title bar
and borders at all? You can archieve the latter by setting the form's
'BorderStyle' property to an appropriate value.
 
I am not attempting to do something specific. I made a Form with a custom
region and wondered why the theming of the Form is gone. Now I know. Thanks.
 
Back
Top