Checkboxes not visible in TAdvGroupBox

I am using the TAdvGroupbox component which has the checkbox functionality that is really great! I am encountering two problems with this control:

  1. For some reason the checkboxes do no show up on my screen at run-time until you move the mouse over them. Once you mouse-over they work properly and look normal. This is a little confusing for the end-user.
  2. The caption is not being moved over to accommodate the size of the checkbox. So at run-time the checkbox is drawn overtop of the caption. This is easily worked-around by adding a few spaces to the beginning of the caption, but I thought I would mention it as I think that would qualify as a bug.

I could not see an issue here.
Can you please share more details, like

  1. full property settings of your TAdvGroupBox
  2. parent control of TAdvGroupBox
  3. Delphi version
  4. TAdvGroupBox version

Thank you for your prompt response.

  1. full property settings of your TAdvGroupBox
  grpSpecialRWP2Handling: TAdvGroupBox;
  grpSpecialRWP2Departments: TAdvGroupBox;
  mmoSpecialRandomWeightDepartments: TMemo;

  grpSpecialRWP2Handling := TAdvGroupBox.Create(Self);
  grpSpecialRWP2Departments := TAdvGroupBox.Create(Self);
  mmoSpecialRandomWeightDepartments := TMemo.Create(Self);

  grpSpecialRWP2Handling.Name := 'grpSpecialRWP2Handling';
  grpSpecialRWP2Handling.Parent := tsnexPOS;
  grpSpecialRWP2Handling.Left := 20;
  grpSpecialRWP2Handling.Top := 224;
  grpSpecialRWP2Handling.Width := 242;
  grpSpecialRWP2Handling.Height := 185;
  grpSpecialRWP2Handling.BorderColor := 12895944;
  grpSpecialRWP2Handling.Transparent := False;
  grpSpecialRWP2Handling.Caption := '    Special Random-Weight/ Price2 Handling';
  grpSpecialRWP2Handling.ParentCtl3D := True;
  grpSpecialRWP2Handling.TabOrder := 3;
  grpSpecialRWP2Departments.Name := 'grpSpecialRWP2Departments';
  grpSpecialRWP2Departments.Parent := grpSpecialRWP2Handling;
  grpSpecialRWP2Departments.Left := 15;
  grpSpecialRWP2Departments.Top := 32;
  grpSpecialRWP2Departments.Width := 210;
  grpSpecialRWP2Departments.Height := 137;
  grpSpecialRWP2Departments.BorderColor := 12895944;
  grpSpecialRWP2Departments.Transparent := False;
  grpSpecialRWP2Departments.Caption := '    Only These Depts';
  grpSpecialRWP2Departments.ParentCtl3D := True;
  grpSpecialRWP2Departments.TabOrder := 0;
  mmoSpecialRandomWeightDepartments.Name := 'mmoSpecialRandomWeightDepartments';
  mmoSpecialRandomWeightDepartments.Parent := grpSpecialRWP2Departments;
  mmoSpecialRandomWeightDepartments.Left := 16;
  mmoSpecialRandomWeightDepartments.Top := 32;
  mmoSpecialRandomWeightDepartments.Width := 177;
  mmoSpecialRandomWeightDepartments.Height := 89;
  mmoSpecialRandomWeightDepartments.TabOrder := 0;
  1. parent control of TAdvGroupBox: TTabSheet in a TPageControl
  2. Delphi version: 10.1 Berlin (Windows 10)
  3. TAdvGroupBox version:

Here is a screen capture of what I am seeing:

Thank you

I see nowhere in your code that you enable these checkboxes and by default, when creating TAdvGroupBox, the checkbox is not visible.

I see the checkbox here when I add
grpSpecialRWP2Handling.CheckBox.Visible := true;
grpSpecialRWP2Handling.CheckBox.Checked := true;

This control has the Checkbox.Visible set to TRUE at design-time.

I tried resetting Checkbox/Visible := TRUE in the FormCreate event also, and it behaves the same way. No checkbox is drawn (checked or unchecked) until I pass the mouse over that area. After I pas the mouse over that area they work like normal checkboxes.

I do not understand it.
You send code that shows programmatic creation of the control and yet you refer to a design-time setting.
I propose you isolate this issue and create a sample source project with which we can reproduce this here.

My apologies for the confusion. I thought you needed to see the properties of the control so I just used the components-to-code wizard from the CNE pack to paste it in. Here is a paste of the component directly.

object grpSpecialRWP2Handling: TAdvGroupBox
  Left = 20
  Top = 224
  Width = 242
  Height = 185
  BorderColor = 12895944
  CaptionFont.Charset = DEFAULT_CHARSET
  CaptionFont.Color = clWindowText
  CaptionFont.Height = -11
  CaptionFont.Name = 'Tahoma'
  CaptionFont.Style = []
  CheckBox.Action = caControlsDisable
  CheckBox.Visible = True
  Transparent = False
  Caption = '    Special Random-Weight/ Price2 Handling'
  ParentCtl3D = True
  TabOrder = 3
  object grpSpecialRWP2Departments: TAdvGroupBox
    Left = 15
    Top = 32
    Width = 210
    Height = 137
    BorderColor = 12895944
    CaptionFont.Charset = DEFAULT_CHARSET
    CaptionFont.Color = clWindowText
    CaptionFont.Height = -11
    CaptionFont.Name = 'Tahoma'
    CaptionFont.Style = []
    CheckBox.Action = caControlsDisable
    CheckBox.Visible = True
    Transparent = False
    Caption = '    Only These Depts'
    ParentCtl3D = True
    TabOrder = 0
    object mmoSpecialRandomWeightDepartments: TMemo
      Left = 16
      Top = 32
      Width = 177
      Height = 89
      TabOrder = 0

Interestingly, when I create a standalone project both the issues I am reporting do not occur. The check box is visible from the start, and the caption is not in the wrong place?

I stepped through all the differences between my project and the test project and it turns out the issue is with the VCL styles! If you enable a VCL Style (I use the "Windows 10" style) the AdvGroupBox.Checkbox does not render properly. Setting the seClient property of StyleElements causes the AdvGroupBox.Checkbox to render properly, albeit unstyled.

I can live with this, but maybe it can be fixed in a future release.

Also... Thanks so much for this component. I use it all the time for nice clean UI's.

Please, as I requested, isolate this and send a test project with which we can reproduce this. We need this to be able to investigate this in an efficient way.

All I did was place a pair of TAdvGroupBox's, enable Checkbox.Visible on both. For one, I turned StyleElements.seClient off and for the other I left it on. It works properly with seCLIENT := FALSE, and does not with it enabled. (5.2 KB)

Compiled EXE here

We see that the base class TCustomGroupBox disables painting when seClient = false. We override Paint to draw the control and paint is not called.
With keeping seClient = false, we found so far not a reliable way to force the paint method to be called.

Thank you for your response. What does this mean for me?

If you need the checkbox, set seClient = true.

This is exactly opposite to the behaviour that I am experiencing. When seClient = TRUE is DOES NOT draw the checkbox.

On the bright side, it does not appear to be obeying the seClient behaviour with respect to the theme as the control is drawn with the theme all the time regardless of this setting?

So... setting seCLIENT := FALSE shows the checkbox AND draws the control in the style of the theme - which is what I need anyway, so this will work fine.

It must be that behavior is different between different Delphi versions then (not the first time we see this, especially in areas of VCL styles & high DPI where the underlying VCL framework is changed by Embarcadero between versions).