views:

147

answers:

1

I have no style set anywhere in my application! alt text

UPDATE: alt text

+5  A: 

This behavior appears to be the default, at least under Windows 7, according to this thread.

It looks like the GroupBox border actually gets an additional white border both inside and outside: just try increasing the BorderThickness, and you'll see what I mean.

Also, compare to another control - a Label, for instance - and notice that when you define a border around that, even a rounded border, there's no white 'shadow'.

As far as I can tell, the only way around this (if you need one) is to define a ControlTemplate for the GroupBox yourself. The link posted above contains a good example: notice the answer that sets the BorderBrush on those surrounding Borders to Transparent.

The canonical example for that custom template can be found in the GroupBox MSDN documentation.

(On an unrelated note, that BorderGapMaskConverter in the example is interesting - that's how the GroupBox knows to render the part of the border beneath the header as transparent... Neat. :))

djacobson
regarding your msdn link there is no answer from any MSFT. Of course this is a Windows 7 bug I very assume... Damn I totally forgot this bounty as I fixed the problem with an own controltemplate last days :P Ok at least you know how to use google go and get away with half of my SO life :/ thx buddy ;-)
Lisa
thanks for pointing out the BorderGapMaskConverter ! interesting indeed!
Patrick Klug