Print Page | Close Window

Problem updating RibbonBar to rel. 18

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=23764
Printed Date: 26 March 2019 at 8:52am


Topic: Problem updating RibbonBar to rel. 18
Posted By: Superpippo
Subject: Problem updating RibbonBar to rel. 18
Date 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



Replies:
Posted By: gibra
Date 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 17.x
Windows 10 64bit
VS2017 - VB6.0 SP6
VS/VB 6.0 Installer v4.8 for Windows


Posted By: agontarenko
Date 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




Print Page | Close Window