GroupBox Background Problem

0
0

Hi,

I have a GroupBox on UserControl1 and UserControl1 is on UserControl2. GroupBox and UserControl1  have default BackColor (@window in designer) and UserControl2 has BackColor Transparent. The frame of groupbox overlays the legend text. Is it a bug or by design?

Thank for your help

Page

Attachment
  • You must to post comments
0
0

The legend is a label placed over the box and if it’s transparent the line will show through. Groupboxes in Wisej are fully themeable so the legend can be above the line, below, over, or any location, or the groupbox can show only a partial line, etc.

If you set the background color to transparent it also goes to the legend, in your case you are setting the parent to transparent but BackgroundColor is an inherited property, so all children will also get the transparent background. When setting the BackgroundColor property it overrides the theme settings. Set the background of the group box (or the parent control) BackgroundColor to “@window” and it will work. If you do it in the designer it may not get serialized because it’s the default, so try do add it in after InitializeComponent().

You can also set the background color of all groupboxes to “@window” by default in your theme or theme mixin:

{
“appearances”: {
“groupbox”: {
“inherit”: “groupbox”,
“states”: {
“default”: {
“properties”: {
“backgroundColor”: “window”
}
}
}
}
}
}

You can see transparencies in the designer if you set ShowDesignerTransparency to true in the top level container (it’s a design time only property). See attached showing a transparent panel with a group box with the non-transparent legend in the designer.

Careful when using ShowDesignerTransparency = true because it’s very heavy on the designer and in complex hierarchy it may hang when the transparent controls overlap or are contained in transparent controls in many levels.

 

 

 

 

Attachment
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.