Back to Devexpress

How to Change the Height of the Ribbon Form's Title in Code

vcl-155078-expressbars-how-to-ribbon-change-the-height-of-the-ribbon-form-s-title-in-code.md

latest1011 B
Original Source

How to Change the Height of the Ribbon Form's Title in Code

  • Jun 11, 2024

The following example demonstrates how to change the Ribbon Form title bar’s height programmatically:

delphi
// ...
uses
// ...
  dxRibbonForm;
// ...
  TRibbonDemoMainForm = class(TdxRibbonForm)
  public
    function GetCaptionHeightDelta(AHasQuickAccessToolbar: Boolean): Integer; override;
// ...
implementation
// ...
function TRibbonDemoMainForm.GetCaptionHeightDelta(
  AHasQuickAccessToolbar: Boolean): Integer;
begin
  Result := 0;
// Indicate that the Ribbon Form's title bar must be 2 pixels shorter if the Ribbon Quick Access Toolbar is located above the Ribbon
  if AHasQuickAccessToolbar then
    Result := -2;
end;

See Also

TdxCustomRibbon.QuickAccessToolbar

TdxRibbonQuickAccessToolbar.Position

Ribbon Quick Access Toolbar