How to make the button appear with the icon and caption?

[ Edited ]


Hello Jason,


Disregard my previous questions, because now you could go a long way through the archives of conferences you provided here on the site.


Now when I need to know how I do that the button that includes the Addin (the type used Toolbar), appear with the icon and caption too ....

I tried using the "CommandButtonBar.Style = seButtonIconAndCaption" but said ...

See the current code of the "OnConnectToEnvironment:

              commandNames(0) = (String.Format("Cadastro{0}Cadastro da Peça / Conjunto{1}Cadastro da Peça / Conjunto{2}Cadastro da Peça / Conjunto", ControlChars.Lf, ControlChars.Lf, ControlChars.Lf))

              commandNames(1) = (String.Format("Banco{0}Cadastro do Sistema de Gestão{1}Cadastro do Sistema de Gestão{2}Cadastro do Sistema de Gestão", ControlChars.Lf, ControlChars.Lf, ControlChars.Lf))

               commandNames(2) = (String.Format("Configura{0}Configurações{1}Configurações{2}Configurações", ControlChars.Lf, ControlChars.Lf, ControlChars.Lf))

               commandNames(3) = (String.Format("Ajuda{0}Ajuda{1}Ajuda{2}Ajuda", ControlChars.Lf, ControlChars.Lf, ControlChars.Lf))


               commandNames(4) = (String.Format("Sobre{0}Sobre o IntegraSE{1}Sobre o IntegraSE{2}Sobre o IntegraSE",            ControlChars.Lf, ControlChars.Lf, ControlChars.Lf))


                commandIDs(0) = 101

                commandIDs(1) = 102

                commandIDs(2) = 103

                commandIDs(3) = 104

                commandIDs(4) = 105

                addin.SetAddInInfo(Marshal.GetHINSTANCE(Me.GetType().Module).ToInt32(), EnvCatID, "IntegraSE", 1, 2, 1, 2, commandIDs.Length, commandNames, commandIDs)


                'If (bFirstTime) Then

                Dim environment As SolidEdgeFramework.Environment

                environment = pEnvironmentDispatch

                environment.CommandBars.Add("IntegraSE", SolidEdgeFramework.SeBarPosition.seBarTop, False, False)

                'Botão Cadastro

                Dim btnCadastro, btnBanco, btnConfigura, btnAjuda, btnSobre As SolidEdgeFramework.ISECommandBarButton

                btnCadastro = addin.AddCommandBarButton(EnvCatID, "IntegraSE", 101)

                btnCadastro.LoadFace(My.Application.Info.DirectoryPath + "\Cadastro.bmp")

                btnCadastro.Caption = "Cadastro da Peça / Conjunto"

                btnCadastro.DescriptionText = "Cadastro da Peça / Conjunto"

                btnCadastro.TooltipText = "Cadastro da Peça / Conjunto"

                'Botão Banco

                btnBanco = addin.AddCommandBarButton(EnvCatID, "IntegraSE", 102)

                btnBanco.LoadFace(My.Application.Info.DirectoryPath + "\Banco.bmp")

                btnBanco.Caption = "Cadastro do Sistema de Gestão"

                btnBanco.DescriptionText = "Cadastro do Sistema de Gestão"

                btnBanco.TooltipText = "Cadastro do Sistema de Gestão"

                'Botão Configura

                btnConfigura = addin.AddCommandBarButton(EnvCatID, "IntegraSE", 103)

                btnConfigura.LoadFace(My.Application.Info.DirectoryPath + "\Configura.bmp")

                btnConfigura.Caption = "Configurações"

                btnConfigura.DescriptionText = "Configurações"

                btnConfigura.TooltipText = "Configurações"

                'Botão Ajuda

                btnAjuda = addin.AddCommandBarButton(EnvCatID, "IntegraSE", 104)

                btnAjuda.LoadFace(My.Application.Info.DirectoryPath + "\Ajuda.bmp")

                btnAjuda.Caption = "Ajuda"

                btnAjuda.DescriptionText = "Ajuda"

                btnAjuda.TooltipText = "Ajuda"

                'Botão Sobre

                btnSobre = addin.AddCommandBarButton(EnvCatID, "IntegraSE", 105)

                btnSobre.LoadFace(My.Application.Info.DirectoryPath + "\Lógica.bmp")

                btnSobre.Caption = "Sobre o IntegraSE"

                btnSobre.DescriptionText = "Sobre o IntegraSE"

                btnSobre.TooltipText = "Sobre o IntegraSE"


Posted by: Fabio Rosa
Post date: 2/20/2009 9:04:40 AM


RE: How to make the button appear with the icon and caption?

[ Edited ]


I have the same problem. Whenever I try to use the LoadFace method on each CommandBarButton object for my addin menu it just shows the image. No matter what I do with setting the caption or button style to show both Icon and Caption, only the icon shows up. It seems like internally Solid Edge does not like having the button style set to seButtonIconAndCaption.


If I don't mess with the CommandBarButton object then I just get a caption as defined through my SetAddinInfo method call. I want to have both an icon and a caption just like most built-in Solid Edge ribbon menus show.


Does anyone have example code that shows how to use the LoadFace command and set the button style correctly? Or if there's a better way of going about it, I'm open to suggestions.  I'm developing with VS 2008 using VB.NET.





Posted by: Mark Nalevanko
Post date: 6/29/2009 4:33:00 AM

RE: How to make the button appear with the icon and caption?

[ Edited ]



if you are triyng on ST, I think is a known bug/issue.




Posted by: Massimo Magris
Post date: 6/30/2009 11:54:35 AM

RE: How to make the button appear with the icon and caption?

[ Edited ]

Should already be fixed in a ST SP (now called "MP"). See the sample add-in I posted today -


Posted by: R.D. Holland
Post date: 8/14/2009 10:24:54 AM