Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - Creating a Ribbon in Delphi
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Creating a Ribbon in Delphi

 Post Reply Post Reply
Author
Message
ggibaut View Drop Down
Newbie
Newbie
Avatar

Joined: 26 June 2007
Location: Argentina
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote ggibaut Quote  Post ReplyReply Direct Link To This Post Topic: Creating a Ribbon in Delphi
    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


Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 26 June 2007 at 3:36pm
Hi,
 
try to move CommadnBarsFrame to form - do not create dynamically.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Dev69 View Drop Down
Groupie
Groupie


Joined: 15 February 2007
Location: France
Status: Offline
Points: 23
Post Options Post Options   Thanks (0) Thanks(0)   Quote Dev69 Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.047 seconds.