Regions and Windows XP

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?
 
H

Herfried K. Wagner [MVP]

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.
 
P

Pieler Aaron

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top