Print Page | Close Window

AddSystemButton problem in .NET/C# and VB

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=5527
Printed Date: 20 June 2025 at 2:01pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: AddSystemButton problem in .NET/C# and VB
Posted By: SBK2K
Subject: AddSystemButton problem in .NET/C# and VB
Date Posted: 15 November 2006 at 8:15am
Hi,

I've tried to add a system button using AddSystemButton to a ribbon bar. I've looked at the samples and no doubt I'm missing something small, and I've also copied the example from the help file and it still isn't working.
 
My code:
 
CommandBars.Icons.LoadBitmap "C:\Program Files\Codejock Software\ActiveX\Xtreme SuitePro ActiveX v10.3.1 (30 Day Trial)\samples\CommandBars\C#.NET\RibbonSample\res\shiny-gear.png", 99, xtpImageNormal
    Dim RibbonBar As RibbonBar
    Set RibbonBar = CommandBars.AddRibbonBar("The Ribbon")
    RibbonBar.EnableDocking xtpFlagStretched
    Dim ControlFile As CommandBarPopup
    Dim Control As CommandBarControl
    Set ControlFile = RibbonBar.AddSystemButton()
    ControlFile.IconId = 99
    With ControlFile.CommandBar.Controls
        .Add xtpControlButton, ID_FILE_NEW, "&New"
        .Add xtpControlButton, ID_FILE_OPEN, "&Open..."
        .Add xtpControlButton, ID_FILE_SAVE, "&Save"
        .Add xtpControlButton, ID_FILE_SAVE_AS, "Save &As..."
        Set Control = .Add(xtpControlButton, ID_FILE_PRINT, "&Print")
        Control.BeginGroup = True
        .Add xtpControlButton, ID_FILE_PRINT_PREVIEW, "Print Pre&view"
        .Add xtpControlButton, ID_FILE_PRINT_SETUP, "Pr&int Setup..."
        Set Control = .Add(xtpControlButton, ID_FILE_MRU_FILE1, "Recent File")
        Control.BeginGroup = True
        Control.Enabled = False
        Set Control = .Add(xtpControlButton, ID_APP_EXIT, "E&xit")
        Control.BeginGroup = True
    End With
This adds the System Menu but there is no icon. The icon is definatley loading correctly because I can assign it to a menu item.
 
This is really frustrating...



Replies:
Posted By: Oleg
Date Posted: 15 November 2006 at 9:46am
Hi,
It works in all our samples. Think you do something wrong.
Attach project in issuetrack to show what you do.


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


Posted By: gaudetm
Date Posted: 17 November 2006 at 10:25am
put the icon in the form icon need to convert it and use only 32x32 size icon, look better


Posted By: SBK2K
Date Posted: 18 November 2006 at 1:49am
I pasted my code; exactly what I did. Where is IssueTrak and how do I submit it?
 
Cheers.



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