<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Need a VB.net example to toggle the custom button image in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/need-a-vb-net-example-to-toggle-the-custom-button-image/m-p/3949671#M130431</link>
    <description>&lt;P&gt;In case you're not familiar with Add-ins, please read this: &lt;A href="http://modthemachine.typepad.com/my_weblog/2010/01/how-to-write-an-inventor-add-in.html" target="_self"&gt;http://modthemachine.typepad.com/my_weblog/2010/01/how-to-write-an-inventor-add-in.html&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 07 Jun 2013 13:33:47 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2013-06-07T13:33:47Z</dc:date>
    <item>
      <title>Need a VB.net example to toggle the custom button image</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/need-a-vb-net-example-to-toggle-the-custom-button-image/m-p/3948433#M130419</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;I have created some custom button in VB.net.I wish I can make those buttons toggling their image. For example my custom button toggles Part/Component priority or Highligt on/off and I would like the button image will change showing the current state. The background image color change will help too, or the some extra tiny mark on working sceen would help if it quite complicated to deal with ribbons. Generally I need to see the current state at glance. Please help Best regards, Orest Yavtushenko&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jun 2013 12:30:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/need-a-vb-net-example-to-toggle-the-custom-button-image/m-p/3948433#M130419</guid>
      <dc:creator>Orest_iy</dc:creator>
      <dc:date>2013-06-06T12:30:53Z</dc:date>
    </item>
    <item>
      <title>Re: Need a VB.net example to toggle the custom button image</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/need-a-vb-net-example-to-toggle-the-custom-button-image/m-p/3948530#M130420</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I guess in the button_onexecute event you can change the icon by&amp;nbsp;setting the buttondefinition.LargeIcon (or StandardIcon) property to a different image.&lt;/P&gt;&lt;P&gt;I haven't tested this, so I'm not sure if it will work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards, Daniël&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jun 2013 13:41:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/need-a-vb-net-example-to-toggle-the-custom-button-image/m-p/3948530#M130420</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-06-06T13:41:31Z</dc:date>
    </item>
    <item>
      <title>Re: Need a VB.net example to toggle the custom button image</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/need-a-vb-net-example-to-toggle-the-custom-button-image/m-p/3948646#M130421</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Once Inventor started it does not let to change a button picture. It executes the macro and required command is executed but&amp;nbsp;did not change the image in the ribbon.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Orest&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jun 2013 14:58:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/need-a-vb-net-example-to-toggle-the-custom-button-image/m-p/3948646#M130421</guid>
      <dc:creator>Orest_iy</dc:creator>
      <dc:date>2013-06-06T14:58:00Z</dc:date>
    </item>
    <item>
      <title>Re: Need a VB.net example to toggle the custom button image</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/need-a-vb-net-example-to-toggle-the-custom-button-image/m-p/3949427#M130422</link>
      <description>&lt;P&gt;I've tried it and for me it seems to work as expected. Could you maybe post your code here so I can try to figure out the problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Daniël&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jun 2013 07:30:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/need-a-vb-net-example-to-toggle-the-custom-button-image/m-p/3949427#M130422</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-06-07T07:30:53Z</dc:date>
    </item>
    <item>
      <title>Re: Need a VB.net example to toggle the custom button image</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/need-a-vb-net-example-to-toggle-the-custom-button-image/m-p/3949522#M130423</link>
      <description>&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;djreesing&lt;/SPAN&gt;&lt;SPAN&gt; I believe&lt;/SPAN&gt; &lt;SPAN&gt;Orest_iy&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt; is talking about a button in the User Commands section of the ribbon bar and not a dialog which I guess you are talking about.&lt;SPAN&gt; &lt;SPAN&gt;Orest_iy&lt;/SPAN&gt;&lt;/SPAN&gt; if you could post a screen shot of the button you are refering to that would clear up any confusion there is.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jun 2013 11:12:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/need-a-vb-net-example-to-toggle-the-custom-button-image/m-p/3949522#M130423</guid>
      <dc:creator>pball</dc:creator>
      <dc:date>2013-06-07T11:12:25Z</dc:date>
    </item>
    <item>
      <title>Re: Need a VB.net example to toggle the custom button image</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/need-a-vb-net-example-to-toggle-the-custom-button-image/m-p/3949535#M130424</link>
      <description>&lt;P&gt;Here is pic attached&lt;/P&gt;&lt;P&gt;I wish the Part Prority/Custom priority as well as Highlight would show the curent state somehow&lt;/P&gt;&lt;P&gt;Orest&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jun 2013 11:27:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/need-a-vb-net-example-to-toggle-the-custom-button-image/m-p/3949535#M130424</guid>
      <dc:creator>Orest_iy</dc:creator>
      <dc:date>2013-06-07T11:27:57Z</dc:date>
    </item>
    <item>
      <title>Re: Need a VB.net example to toggle the custom button image</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/need-a-vb-net-example-to-toggle-the-custom-button-image/m-p/3949548#M130425</link>
      <description>&lt;P&gt;pball, I'm also talking about the ribbon toolbar. See attached images before and after clicking the button. I've used an icon of a cd-rom and dvd for this example.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Orest_iy, please post your code here so we can figure out whats wrong.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jun 2013 11:41:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/need-a-vb-net-example-to-toggle-the-custom-button-image/m-p/3949548#M130425</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-06-07T11:41:18Z</dc:date>
    </item>
    <item>
      <title>Re: Need a VB.net example to toggle the custom button image</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/need-a-vb-net-example-to-toggle-the-custom-button-image/m-p/3949551#M130426</link>
      <description>&lt;P&gt;By the way, I see you are using Inventor 2012. I've tested this with Inventor 2013, but I doubt that this functionality&amp;nbsp;was added in the 2013 API.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jun 2013 11:46:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/need-a-vb-net-example-to-toggle-the-custom-button-image/m-p/3949551#M130426</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-06-07T11:46:47Z</dc:date>
    </item>
    <item>
      <title>Re: Need a VB.net example to toggle the custom button image</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/need-a-vb-net-example-to-toggle-the-custom-button-image/m-p/3949578#M130427</link>
      <description>Wow I've never run across this functionality before. I've only found a few articles on using icons period. It's nice to be wrong some times.</description>
      <pubDate>Fri, 07 Jun 2013 12:24:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/need-a-vb-net-example-to-toggle-the-custom-button-image/m-p/3949578#M130427</guid>
      <dc:creator>pball</dc:creator>
      <dc:date>2013-06-07T12:24:48Z</dc:date>
    </item>
    <item>
      <title>Re: Need a VB.net example to toggle the custom button image</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/need-a-vb-net-example-to-toggle-the-custom-button-image/m-p/3949582#M130428</link>
      <description>&lt;P&gt;It's not really rocket science &lt;img id="smileywink" class="emoticon emoticon-smileywink" src="https://forums.autodesk.com/i/smilies/16x16_smiley-wink.png" alt="Smiley Wink" title="Smiley Wink" /&gt;. Just changing the 'LargeIcon' and/or 'StandardIcon'&amp;nbsp;property of the button definition. Apparently there is no problem doing this during runtime.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Daniël&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jun 2013 12:29:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/need-a-vb-net-example-to-toggle-the-custom-button-image/m-p/3949582#M130428</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-06-07T12:29:43Z</dc:date>
    </item>
    <item>
      <title>Re: Need a VB.net example to toggle the custom button image</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/need-a-vb-net-example-to-toggle-the-custom-button-image/m-p/3949640#M130429</link>
      <description>Could you share some code please. I don't have a use for this currently but it's piqued my interest and I don't have a clue where/how you are doing this.</description>
      <pubDate>Fri, 07 Jun 2013 13:12:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/need-a-vb-net-example-to-toggle-the-custom-button-image/m-p/3949640#M130429</guid>
      <dc:creator>pball</dc:creator>
      <dc:date>2013-06-07T13:12:36Z</dc:date>
    </item>
    <item>
      <title>Re: Need a VB.net example to toggle the custom button image</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/need-a-vb-net-example-to-toggle-the-custom-button-image/m-p/3949658#M130430</link>
      <description>&lt;P&gt;First of all this is done in a VB.NET add-in (Visual Basic 2010 Express).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the code in the activate section of the add-in (where the button is declared and put&amp;nbsp;in a ribbon).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;            Dim oControlDefinitions As ControlDefinitions
            Dim oUIManager As UserInterfaceManager

            oControlDefinitions = m_inventorApplication.CommandManager.ControlDefinitions
            oUIManager = m_inventorApplication.UserInterfaceManager

            oTestButton = oControlDefinitions.AddButtonDefinition("Test Button", "oTestButton", CommandTypesEnum.kQueryOnlyCmdType, sClientID)

            oTestButton.LargeIcon = clsPictureDispConverter.ToIPictureDisp(New System.Drawing.Icon(My.Resources.Compact_Disk, 32, 32))

            If firstTime = True Then

                '===Ribbon section===
                Dim oRibbon As Ribbon
                Dim oTestRibbon As RibbonTab
                Dim oTestPanel As RibbonPanel

                For Each oRibbon In oUIManager.Ribbons

                    ' Create a new tab
                    oTestRibbon = oRibbon.RibbonTabs.Add("Test Ribbon", "oTestRibbon", sClientID)

                    ' Create a new panel within the tab
                    oTestPanel = oTestRibbon.RibbonPanels.Add("Test Panel", "oTestPanel", sClientID)

                    ' Create a control within the panel
                    Call oTestPanel.CommandControls.AddButton(oTestButton, True)

                Next oRibbon

            End If&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the code in the oTestButton_OnExecute event.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;oTestButton.LargeIcon = clsPictureDispConverter.ToIPictureDisp(New System.Drawing.Icon(My.Resources.DVD_Disk, 32, 32))&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The clsPictureDispConverter is a custom class that contains a function for converting the icon to an IPictureDisp. See &lt;A href="http://modthemachine.typepad.com/my_weblog/2012/02/bitmaps-without-vb6-icontoipicture.html" target="_self"&gt;http://modthemachine.typepad.com/my_weblog/2012/02/bitmaps-without-vb6-icontoipicture.html&lt;/A&gt;&amp;nbsp;for more information.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope you can understand how this works now.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Daniël&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jun 2013 13:27:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/need-a-vb-net-example-to-toggle-the-custom-button-image/m-p/3949658#M130430</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-06-07T13:27:17Z</dc:date>
    </item>
    <item>
      <title>Re: Need a VB.net example to toggle the custom button image</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/need-a-vb-net-example-to-toggle-the-custom-button-image/m-p/3949671#M130431</link>
      <description>&lt;P&gt;In case you're not familiar with Add-ins, please read this: &lt;A href="http://modthemachine.typepad.com/my_weblog/2010/01/how-to-write-an-inventor-add-in.html" target="_self"&gt;http://modthemachine.typepad.com/my_weblog/2010/01/how-to-write-an-inventor-add-in.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jun 2013 13:33:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/need-a-vb-net-example-to-toggle-the-custom-button-image/m-p/3949671#M130431</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-06-07T13:33:47Z</dc:date>
    </item>
    <item>
      <title>Re: Need a VB.net example to toggle the custom button image</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/need-a-vb-net-example-to-toggle-the-custom-button-image/m-p/3949711#M130432</link>
      <description>&lt;P&gt;Inventor 2013 gave me so much troubles with those appereances and crashes in attempt to change or create something custom so I stay the second year on 2012.&lt;/P&gt;&lt;P&gt;The idea of switching Large and Small icons probably could be the sollution.Did not tried it yet.&lt;/P&gt;&lt;P&gt;Thank you for advice.&lt;/P&gt;&lt;P&gt;I can test it&amp;nbsp;on Monday, everything is on working machine.&lt;/P&gt;&lt;P&gt;Orest&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jun 2013 14:01:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/need-a-vb-net-example-to-toggle-the-custom-button-image/m-p/3949711#M130432</guid>
      <dc:creator>Orest_iy</dc:creator>
      <dc:date>2013-06-07T14:01:33Z</dc:date>
    </item>
    <item>
      <title>Re: Need a VB.net example to toggle the custom button image</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/need-a-vb-net-example-to-toggle-the-custom-button-image/m-p/4293946#M130433</link>
      <description>&lt;P&gt;Hello again,&lt;/P&gt;&lt;P&gt;Here is my code attached.&lt;/P&gt;&lt;P&gt;The whole project is zipped.&lt;/P&gt;&lt;P&gt;I wish my custom button would change the Large image to Standard image in the executable event.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Orest&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jun 2013 14:46:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/need-a-vb-net-example-to-toggle-the-custom-button-image/m-p/4293946#M130433</guid>
      <dc:creator>Orest_iy</dc:creator>
      <dc:date>2013-06-10T14:46:28Z</dc:date>
    </item>
    <item>
      <title>Re: Need a VB.net example to toggle the custom button image</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/need-a-vb-net-example-to-toggle-the-custom-button-image/m-p/4294698#M130434</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In your case you should use the following command to set an icon or the buttondefinition.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;mAsmButtonDef.LargeIcon = mIPictureDisp1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In your mAsmButtonDef_OnExecute event you don't need to set the buttondefintion again. You can simple change the icon by the above command.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Look to one of my last posts where I posted my my code. That should explain it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Daniël&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jun 2013 05:48:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/need-a-vb-net-example-to-toggle-the-custom-button-image/m-p/4294698#M130434</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-06-11T05:48:52Z</dc:date>
    </item>
    <item>
      <title>Re: Need a VB.net example to toggle the custom button image</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/need-a-vb-net-example-to-toggle-the-custom-button-image/m-p/4295087#M130435</link>
      <description>&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;Everything is working now&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Orest&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jun 2013 13:44:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/need-a-vb-net-example-to-toggle-the-custom-button-image/m-p/4295087#M130435</guid>
      <dc:creator>Orest_iy</dc:creator>
      <dc:date>2013-06-11T13:44:56Z</dc:date>
    </item>
  </channel>
</rss>

