Showing results for 
Search instead for 
Did you mean: 

Help me please!

Valued Contributor
Valued Contributor


Tell me about how do I add images to the buttons I'm creating this code .... when I open the Solid Edge is only the text but not in the form of a button ....


Please, if anyone knows what to do, answer me!


See the code below the class


Imports System.Runtime.InteropServices

Imports Microsoft.Win32

Imports System.Reflection

Imports System.Collections

Imports System.Collections.Generic

ProgIdAttribute("IntegraSE.Integra"), _

ComVisible(True)> _

Public Class Integra

    Implements SolidEdgeFramework.ISolidEdgeAddIn, SolidEdgeFramework.ISEAddInEvents

    Private objAddin As SolidEdgeFramework.AddIn

    Private objApplication As SolidEdgeFramework.Application   

    Public Sub OnConnection(ByVal Application As Object, ByVal ConnectMode As SolidEdgeFramework.SeConnectMode, ByVal AddInInstance As SolidEdgeFramework.AddIn) Implements SolidEdgeFramework.ISolidEdgeAddIn.OnConnection

        objAddin = AddInInstance

        objApplication = Application

        AddInInstance.GuiVersion = 1

        AddInInstance.Description = "Integração com Forwood / Fabril / SIG"

    End Sub

    Public Sub OnConnectToEnvironment(ByVal EnvCatID As String, ByVal pEnvironmentDispatch As Object, ByVal bFirstTime As Boolean) Implements SolidEdgeFramework.ISolidEdgeAddIn.OnConnectToEnvironment

        Dim commandNames As Array = Array.CreateInstance(GetType(String), 2)

        Dim commandIDs As Array = Array.CreateInstance(GetType(Integer), 2)


            commandNames.SetValue(String.Format("Cadastro{0}Cadastro da Peça / Conjunto{1}Cadastro da Peça / Conjunto no Sistema de Gestão{2}Cadastro da Peça / Conjunto no Sistema de Gestão", ControlChars.Lf, ControlChars.Lf, ControlChars.Lf), 0)

            commandNames.SetValue(String.Format("Estrutura{0}Visualização Conjunto / Montagem{1}Visualização Conjunto / Montagem{2}Visualização Conjunto / Montagem", ControlChars.Lf, ControlChars.Lf, ControlChars.Lf), 1)

            commandIDs.SetValue(1, 0)

            commandIDs.SetValue(2, 1)           

            objAddin.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)

                objAddin.AddCommandBarButton(EnvCatID, "IntegraSE1", 1)

                objAddin.AddCommandBarButton(EnvCatID, "IntegraSE2", 2)

            End If

        Catch ex As Exception


        End Try

    End Sub


    Public Sub OnDisconnection(ByVal DisconnectMode As SolidEdgeFramework.SeDisconnectMode) Implements SolidEdgeFramework.ISolidEdgeAddIn.OnDisconnection

        If Not (objAddin Is Nothing) Then

            objAddin = Nothing

        End If

        If Not (objApplication Is Nothing) Then

            objApplication = Nothing

        End If

    End Sub


    Public Shared Sub RegisterFunction(ByVal t As Type)

        Dim baseKey As RegistryKey = Nothing

        Dim summaryKey As RegistryKey = Nothing

        Dim title As AssemblyTitleAttribute

        Dim description As AssemblyDescriptionAttribute


            baseKey = Registry.ClassesRoot.CreateSubKey("CLSID\{" + t.GUID.ToString + "}")

            baseKey.SetValue("AutoConnect", 1)

            If t.Assembly.IsDefined(GetType(AssemblyTitleAttribute), True) Then

                title = AssemblyTitleAttribute.GetCustomAttribute(t.Assembly, GetType(AssemblyTitleAttribute))

                baseKey.SetValue("409", title.Title)

            End If

            If t.Assembly.IsDefined(GetType(AssemblyDescriptionAttribute), True) Then

                description = AssemblyDefaultAliasAttribute.GetCustomAttribute(t.Assembly, GetType(AssemblyDescriptionAttribute))

                summaryKey = baseKey.CreateSubKey("Summary")

                summaryKey.SetValue("409", description.Description)


            End If


            baseKey.CreateSubKey("Implemented Categories\{26B1D2D1-2B03-11d2-B589-080036E8B802}")

            'All Envirenment Documents

            baseKey.CreateSubKey("Environment Categories\{BAD41B8D-18FF-42c9-9611-8A00E6921AE8}")

        Catch ex As Exception



            If Not (summaryKey Is Nothing) Then


            End If

            If Not (baseKey Is Nothing) Then


            End If

        End Try

    End Sub


    Public Shared Sub UnregisterFunction(ByVal t As Type)


            Registry.ClassesRoot.DeleteSubKeyTree("CLSID\{" + t.GUID.ToString + "}")

        Catch ex As Exception

        End Try

    End Sub

    'Addin Events

    Public Sub OnCommand(ByVal CommandID As Integer) Implements SolidEdgeFramework.ISEAddInEvents.OnCommand


    End Sub


    Public Sub OnCommandHelp(ByVal hFrameWnd As Integer, ByVal HelpCommandID As Integer, ByVal CommandID As Integer) Implements SolidEdgeFramework.ISEAddInEvents.OnCommandHelp


    End Sub


    Public Sub OnCommandUpdateUI(ByVal CommandID As Integer, ByRef CommandFlags As Integer, ByRef MenuItemText As String, ByRef BitmapID As Integer) Implements SolidEdgeFramework.ISEAddInEvents.OnCommandUpdateUI


    End Sub

End Class



Posted by: Fabio Rosa
Post date: 2/16/2009 7:32:01 AM


RE: Help me please!

Valued Contributor
Valued Contributor

Answered in previous post. I'm locking this one.


Posted by: Jason Newell
Post date: 2/17/2009 1:50:01 PM