Nested Groupboxes

  • Thread starter Thread starter Joe Griffith
  • Start date Start date
J

Joe Griffith

If xp styles are in use (Application.EnableVisualStyles) and you nest
one group box inside another then the text (caption) of the inner
groupbox is automatically displayed in bold regardless of the font
setting. In addition the length of the text is limited to what it would
be if the text wasn't bold so the text is effectivly truncated.

Is there a way around this problem?
 
This appears to be a bug introduced with Framework 1.1 SP1. A quick fix is
to Dock a panel inside the groupbox and place the nested Groupbox on the
panel.
 
Thanks. Adding a panel in the outer groupbox does indeed solve the
problem (or at least mask it). Seems sort of crude... because I guess
it is.

Nested groupboxes isn't a pattern I use much, but I don't know where I
used it in a solution that has several hundred forms. I guess I'm going
to have to look at every one or just wait till our customers complain.

I'm glad you mentioned that it was introduced with SP1 because I
couldn't believe that I had let it get into our production product. Are
there any more 'introduced bugs' you know of?
 
I'm not aware of any others. This one stood out for me though, since it's
really an introduction of an old problem. This is the same behaviour as in
VBClassic and I actually wrote a Groupbox control to overcome it when I was
coding in VB6.
 
Back
Top