Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - EnableOffice2007Frame Not Working
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

EnableOffice2007Frame Not Working

 Post Reply Post Reply
Author
Message
GarethThom View Drop Down
Groupie
Groupie
Avatar

Joined: 07 November 2006
Location: United Kingdom
Status: Offline
Points: 19
Post Options Post Options   Thanks (0) Thanks(0)   Quote GarethThom Quote  Post ReplyReply Direct Link To This Post Topic: EnableOffice2007Frame Not Working
    Posted: 08 February 2011 at 7:55am
The Environment:
Xtreme SuitePro ActiveX 2009 Vol 4 (13.4.2)
VB6 SP6
Reproducible on Vista & W7 (both 32 bit), in IDE and at Runtime

The Problem:
The title bar displays in black and removes the min, max and close buttons at the top right of the form as shown here in the Codejock Ribbon MDI Sample (slightly modified - see below):


The Investigation:
I have finally managed to track down the above display problem to calling the following line of code before any command bars / ribbon is added:

CommandBars.EnableOffice2007Frame True

This can easily be replicated if you take the standard Codejock Ribbon MDI Sample VB6 application and insert the above line before "LoadIcons" in MDIForm_Load() as follows:

Private Sub MDIForm_Load()
    CommandBars.EnableOffice2007Frame True
    LoadIcons
    CreateRibbonBar
    ...
    ...
End Sub

It would appear that if you place the call to EnableOffice2007Frame after the ribbon is created you do not get the office theme applied. This is demonstrated using the standard Codejock SDI Sample whereby ticking and unticking the "Office 2007 Frame" check box appears to do absolutely nothing.

I will be upgrading to v15 when (if?) it comes out tomorrow so if it is fixed in that release I personally will not be to bothered if it is fixed in v13.4.2 or not. As it stands, however, unless someone can suggest a workaround it looks as if I will have to disable the 2007 frame before the next release.

Thanks in advance,
Gareth
Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post Posted: 08 February 2011 at 8:59am
Just call RibbonBar.EnableFrameTheme after you create ribbon, statusbar, etc...
Back to Top
Xander75 View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 April 2007
Status: Offline
Points: 353
Post Options Post Options   Thanks (0) Thanks(0)   Quote Xander75 Quote  Post ReplyReply Direct Link To This Post Posted: 08 February 2011 at 9:22am
As your investigation suggested and as per Supermario's suggestion you must always call: "CommandBars.EnableOffice2007Frame True" after you have created your RibbonBar.

It's not a bug that needs fixed, people just need to be aware that there is a method to creating the RibbonBar, which you now know.

Product: Xtreme SuitePro (ActiveX) v15.3.1
Platform: Windows 7 64-bit (SP1) Professional Edition
Languages: C#.Net using Visual Studio 2012 & Visual Basic 6.0 (SP6)
Back to Top
GarethThom View Drop Down
Groupie
Groupie
Avatar

Joined: 07 November 2006
Location: United Kingdom
Status: Offline
Points: 19
Post Options Post Options   Thanks (0) Thanks(0)   Quote GarethThom Quote  Post ReplyReply Direct Link To This Post Posted: 08 February 2011 at 11:04am
Thanks for getting back to me, but I appear not to have described the problem properly.

If we take the standard SDI Sample then this is what it looks like on Windows Server 2008 with "Office 2007 Frame" unticked:



and this is what it looks like ticked:



Notice the Office 2007 style title bar as expected/desired.

Running the exact same .exe on Vista produces this with "Office 2007 Frame" ticked:



And looks identical with the "Office 2007 Frame" unticked, i.e. regardless of whether EnableOffice2007Frame is on or off, the title bar is not themed as per Office 2007 (shown above).

This appears to be the same when applied to the ribbon (regardless of calling RibbonBar.EnableFrameTheme or not).

Can someone please look at this again and clarify how to make this work?

Thanks again,
G.
Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 08 February 2011 at 11:29am
Windows Vista & 7 Aero overrides the CommandBars theme. The only way I know to overcome this is to disable desktop composition (Aero) when your program starts, but unfortunately this is a system-wide setting, so it will likely bother your users more than if you leave the Aero theme alone.

If you still want to do this, here's some code (untested by me) that claims to accomplish this:
http://www.vbforums.com/showpost.php?p=3296097&postcount=7
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6

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: 09 February 2011 at 1:49am
Hi,

Yes, its designed behavior of EnableOffice2007Frame. Office products look same in Vista/Windows7.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
GarethThom View Drop Down
Groupie
Groupie
Avatar

Joined: 07 November 2006
Location: United Kingdom
Status: Offline
Points: 19
Post Options Post Options   Thanks (0) Thanks(0)   Quote GarethThom Quote  Post ReplyReply Direct Link To This Post Posted: 09 February 2011 at 4:06am
Fair enough, but I would make two observations:
  1. It should probably not turn the title bar black (in what appears to be a failed attempt to apply the theme making it look like a bug) when the call to EnableOffice2007Frame is made before any command bars are added
  2. There should also be some kind of documentation stating that this is not designed to work in Vista/W7 when the Aero theme is in use. Current documentation on the EnableOffice2007Frame Method states only the following:
    • Specifies that the Office 2007 style frame will be used
    • EnableOffice2007Frame is useful when the Office 2007 visual theme is applied so the entire application is Office 2007 themed
Thanks for everyone's help,
G.
Back to Top
free_user View Drop Down
Groupie
Groupie
Avatar

Joined: 08 March 2006
Status: Offline
Points: 24
Post Options Post Options   Thanks (0) Thanks(0)   Quote free_user Quote  Post ReplyReply Direct Link To This Post Posted: 12 November 2011 at 2:39am

Hi

i am using Ribbonbar with design with commandbar designer.

axCommandBars1.DesignerControls.DeleteAll();
axCommandBars1.LoadDesignerBars("d:\\Shop_Ribbon.xcb", "Ribbon_Shop");
axCommandBars1.EnableOffice2007Frame(true);

how can i use "EnableFrameTheme" with code.

Sorry for my bad english.

Xtreme SuitePro (ActiveX) version 15.1.3
C# 2010
Xp Sp3
Back to Top
free_user View Drop Down
Groupie
Groupie
Avatar

Joined: 08 March 2006
Status: Offline
Points: 24
Post Options Post Options   Thanks (0) Thanks(0)   Quote free_user Quote  Post ReplyReply Direct Link To This Post Posted: 22 January 2012 at 6:45am
hi
no answer for my question?
Sorry for my pure English.
 
Xtreme SuitePro (ActiveX) version 15.1.3
C# 2010
Xp Sp3
Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post Posted: 23 January 2012 at 9:19am
           CommandBars.EnableOffice2007Frame True
            CommandBarsGlobalSettings.ResourceImages.LoadFromFile App.Path & "\..\..\..\Styles\Office2010.dll", "Office2010Blue.ini"
            CommandBars.VisualTheme = xtpThemeRibbon

What do you mean you have no controls?  You use the designer so you see no controls in CommandBars.DesignerControls?

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.157 seconds.