Search code examples
delphivcldelphi-xetcategorypanelgroup

Remove tcategorypanel border


How can you remove the border from TCategoryPanel and TCategoryPanelGroup in XE3?

Tried this and didn't work:

type
   TCategoryPanel =  class (Vcl.ExtCtrls.TCategoryPanel)
protected
   procedure  CreateParams ( var  Params: TCreateParams);  override ;
end ;

procedure  TCategoryPanel.CreateParams ( var  Params: TCreateParams);
begin
  Inherited ;
  Params.Style:= Params.Style  and  not  WS_BORDER;
end ;

Solution

  • For TCategoryPanel you need to set the protected property BevelOuter to bvNone.

    For TCategoryPanelGroup you can indeed remove the border in CreateParams. Like so:

    Params.Style := Params.Style and (not WS_BORDER);
    

    It looks like this:

    enter image description here