Search code examples
delphivcldelphi-10.4-sydney

How to temporarily disable a single TButtonCategory?


In a Delphi 10.4.2 VCL Application, I have a TCategoryButtons object, containing several Categories (TButtonCategory). Unfortunately, TButtonCategory has not an Enabled property:

CategoryButtons1.Categories[0].Enabled := False; // undeclared identifier

So how can I temporarily disable a single TButtonCategory Category while leaving the other Categories enabled?


Solution

  • Category buttons (TButtonItem) have no Visible property as well as no Enabled property. They are always visible and enabled. This extends to the TButtonCategory, which is also always visible and enabled, but you can collapse it.