Print Page | Close Window

Creating a Ribbon in Delphi

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=7453
Printed Date: 18 June 2025 at 1:39pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Creating a Ribbon in Delphi
Posted By: ggibaut
Subject: Creating a Ribbon in Delphi
Date Posted: 26 June 2007 at 12:06pm
How do you create a Ribbon in Delphi 7?

I imported the ActiveX using Delphi Wizard.
A sample sketch of my code is the following:

procedure TForm1.FormCreate(Sender: TObject);
var
  CommandBarsFrame: TCommandBarsFrame;
  Ribbon: IRibbonBar;
begin
  CommandBarsFrame :=   TCommandBarsFrame.CreateParented(Self.Handle);
  CommandBarsFrame.EnableOffice2007Frame(True);
  CommandBarsFrame.VisualTheme := xtpThemeRibbon;
  Ribbon := CommandBarsFrame.AddRibbonBar(Widestring('Sample'));
  Assert(Ribbon <> nil); //the Ribbon is always nil
end;

What i´m missing?

Thanks in advance





Replies:
Posted By: Oleg
Date Posted: 26 June 2007 at 3:36pm
Hi,
 
try to move CommadnBarsFrame to form - do not create dynamically.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: Dev69
Date Posted: 02 July 2007 at 10:37am
Do You really need Frame object...

the following code works perfectly

  FCommandBars := TCommandBars.CreateParented(FFormOwner.Handle);
  FRibbon := FCommandBars.AddRibbonBar(FFormOwner.Name)

regards



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net