Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - Problem updating RibbonBar to rel. 18
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Problem updating RibbonBar to rel. 18

 Post Reply Post Reply
Author
Message
Superpippo View Drop Down
Groupie
Groupie


Joined: 02 March 2005
Status: Offline
Points: 67
Post Options Post Options   Thanks (0) Thanks(0)   Quote Superpippo Quote  Post ReplyReply Direct Link To This Post Topic: Problem updating RibbonBar to rel. 18
    Posted: 14 November 2018 at 1:10pm
I have updated a simple vb6 project to codejock rel 18.
The code have a simple ribbon bar and with codejock rel 15 it works with a nice blue ribbonbar, updating to commandbar control to rel 18 the ribbon is black.

What's wrong ?

the code to create the ribbonbar is the following, simply create a vb6 form put a commandbar control inside it and copy the following code in the form load event:

    Dim MyRibbonBar As RibbonBar
    Dim RibTab As RibbonTab
    Dim RibGroup As RibbonGroup
    Dim Control As CommandBarControl
    
    'create a ribbonbar
    Set MyRibbonBar = CommandBars.AddRibbonBar("The Ribbon")
    MyRibbonBar.EnableDocking xtpFlagStretched
    
    'create a tab
    Set RibTab = MyRibbonBar.InsertTab(0, "&TestTab")

    'create a group
    Set RibGroup = RibTab.Groups.AddGroup("FirstGroup", 1)
    RibGroup.Caption = "FirstGroup"

    'create a control
    Set Control = RibGroup.Add(xtpControlButton, 100, "FirstButton", -1, False)
'    Control.BeginGroup = BeginGroup
    Control.DescriptionText = "FirstButton"
    Control.Style = 0 'ButtonStyle
    Control.Category = "controls" 'Category

    'refresh ribbonbar
    MyRibbonBar.RecalcLayout

Thanks a lot



SuperPippo
Back to Top
gibra View Drop Down
Senior Member
Senior Member


Joined: 31 October 2008
Location: Italy
Status: Offline
Points: 288
Post Options Post Options   Thanks (0) Thanks(0)   Quote gibra Quote  Post ReplyReply Direct Link To This Post Posted: 15 November 2018 at 4:10am
I confirm this problem (using 16.4 and 18.2 versions)
With 15.3 works fine.
gibra
CJ SuiteControl v: 13.x to 19.x
Windows 10 64bit
VS2019 - VB6.0 SP6
<a href="http://nuke.vbcorner.net/Home/tabid/36/language/en-US/Default.aspx" rel="nofollow">VS/VB 6.0 Installer v6.8
Back to Top
agontarenko View Drop Down
Admin Group
Admin Group


Joined: 25 March 2016
Status: Offline
Points: 260
Post Options Post Options   Thanks (0) Thanks(0)   Quote agontarenko Quote  Post ReplyReply Direct Link To This Post Posted: 07 January 2019 at 11:12am
Hello,
you need to add code with style initialization as below

    Dim MyRibbonBar As RibbonBar
    Dim RibTab As RibbonTab
    Dim RibGroup As RibbonGroup
    Dim Control As CommandBarControl
    
    'create a ribbonbar
    Set MyRibbonBar = CommandBars.AddRibbonBar("The Ribbon")
    MyRibbonBar.EnableDocking xtpFlagStretched
    
    'create a tab
    Set RibTab = MyRibbonBar.InsertTab(0, "&TestTab")

    'create a group
    Set RibGroup = RibTab.Groups.AddGroup("FirstGroup", 1)
    RibGroup.Caption = "FirstGroup"

    'create a control
    Set Control = RibGroup.Add(xtpControlButton, 100, "FirstButton", -1, False)
'    Control.BeginGroup = BeginGroup
    Control.DescriptionText = "FirstButton"
    Control.Style = 0 'ButtonStyle
    Control.Category = "controls" 'Category

    'refresh ribbonbar
    MyRibbonBar.RecalcLayout

  CommandBarsGlobalSettings.ResourceImages.LoadFromFile App.path & "\Styles\Office2016.dll", "Office2016WordColorful.ini"
  CommandBars.VisualTheme = xtpThemeOffice2016
  CommandBars.EnableFrameTheme True

Regards,
Artem Gontarenko

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