locked
Change the Icon of the ToolWindow RRS feed

  • Question

  • I have the icon working fine for the Menu (Tools > [My Package Name])

    but the Icon of the Tool Window when it displays as a Tab is still displaying a "2" Icon from the original bitmap

    that Visual Studio created, even though icon does not exist any more; I have found the area in the code where it refers to:

    <Button guid="guidRegionizerCmdSet" id="cmdRegionizerCommand" priority="0x0100" type="Button">

            <Parent guid="guidRegionizerCmdSet" id="RegionizerGroup" />

            <Icon guid="guidImages" id="Regionizer1" />

            <Strings>

              <CommandName>cmdRegionizerCommand</CommandName>

              <ButtonText>Regionizer</ButtonText>

            </Strings>

          </Button>

     

     

          <Button guid="guidRegionizerCmdSet" id="cmdRegionizerWindow" priority="0x0100" type="Button">

            <Parent guid="guidSHLMainMenu" id="IDG_VS_WNDO_OTRWNDWS1"/>

            <Icon guid="guidImages2" id="Regionizer3" />

            <Strings>

              <CommandName>cmdRegionizerWindow</CommandName>

              <ButtonText></ButtonText>

            </Strings>

          </Button>

     

     

    <!--The bitmaps section is used to define the bitmaps that are used for the commands.-->

        <Bitmaps>

          <!--  The bitmap id is defined in a way that is a little bit different from the others:

                the declaration starts with a guid for the bitmap strip, then there is the resource id of the

                bitmap strip containing the bitmaps and then there are the numeric ids of the elements used

                inside a button definition. An important aspect of this declaration is that the element id

                must be the actual index (1-based) of the bitmap inside the bitmap strip. -->

          <Bitmap guid="guidImages" href="Resources\Regionizer.bmp" usedList="Regionizer1, Regionizer2" />

          <Bitmap guid="guidImages2" href="Resources\Regionizer24.bmp" usedList="Regionizer3" />

        </Bitmaps>

     

    And I have read all about using bitmaps and setting the value in the GuidList:

    </GuidSymbol>

       

        <GuidSymbol name="guidImages" value="{c8f906fb-1267-43f5-9557-77c71d93efd9}" >

          <IDSymbol name="Regionizer1" value="1" />

          <IDSymbol name="Regionizer2" value="2" />

        </GuidSymbol>

        <GuidSymbol name="guidImages2" value="{52040bdf-9f49-4ddf-94c5-106cc6eae98a}" >

          <IDSymbol name="Regionizer3" value="3" />

        </GuidSymbol>

      </Symbols>

     

    Any Idea why I am still getting the "2" icon on the ToolWindow pane? That icon no longer exists on the file system for that directory, so unless Visual Studio is Caching the value some way;

    I also created new Guids for the guidImages and that didn't work;

     

    I have tested this in the Expiramental hive and by installing the Package and I get the same result, a 2 Icon;  Does anyone know where to look to fix this or what I should do?

     

    Thank you,

    Corby

    Tuesday, September 21, 2010 3:44 PM

Answers

  • Hi Corby,

     

    Thanks for your post.

    I've tried to change the icon with a VSCT file similar as yours, but I failed to reproduce the issue.

    So I think it might not be your code problem.

    Did you just test it in experimental hive?

    If so, I noticed that, if you just did a little change in VSCT file, and build->debug the package, experimental hive will not reinstall this package.

    Would you please uninstall the package manually in experimental hive or just clean build of the project and try to debug it again?

    Hope this can help.

     

    Best Regards,

    Ziwei Chen

    • Marked as answer by Corby Nichols Saturday, September 25, 2010 10:50 PM
    Friday, September 24, 2010 1:22 AM

All replies

  • Hi Corby,

     

    Thanks for your post.

    I've tried to change the icon with a VSCT file similar as yours, but I failed to reproduce the issue.

    So I think it might not be your code problem.

    Did you just test it in experimental hive?

    If so, I noticed that, if you just did a little change in VSCT file, and build->debug the package, experimental hive will not reinstall this package.

    Would you please uninstall the package manually in experimental hive or just clean build of the project and try to debug it again?

    Hope this can help.

     

    Best Regards,

    Ziwei Chen

    • Marked as answer by Corby Nichols Saturday, September 25, 2010 10:50 PM
    Friday, September 24, 2010 1:22 AM
  • Thank you for your reply;

    Can you explain to me how to have the Experimental hive reinstall the package, or a Clean Build of the project (I understand how to do a Build > Clean I just want to make sure that is all you are talking about.

    Where does Visual Studio install a Package for the Experimental Hive and where does Visual Studio install a package for the normal VS.

    Thank you again; My next attempt was to start a clean project and get the icons working and then add all the code back, but that is alot of work so I hope I solve this without that.

    Thank you,

    Corby

    Saturday, September 25, 2010 11:55 AM
  • I recreated a new project, and before I ever ran the project I changed out the problem;

    This time I get the icon for the Menu item (same as before) but the icon for the Tool Window is missing, which is ok, I just hated the "2" that was the default icon;

    I wish no icon was the default or I wish the Tool Window icon works the same as the Menu Item Icon like this:

    <Bitmap guid="guidImages" href="Resources\Regionizer32.bmp" usedList="RegionizerMain"/>

    But the Tool Window icon is set like this:

    <data name="301" type="System.Resources.ResXFileRef, System.Windows.Forms">
      <value>Resources\Regionizer24.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
     </data>

    And is called by the tool window like this:

    this.BitmapResourceID = 301;
    this.BitmapIndex = 1;

    So I am not sure why icons are set differently in different locations but the problem of no icon is better than the wrong icon so I am going to close this issue.

    Thank you Ziwei Chen for all your help,

    Saturday, September 25, 2010 10:50 PM
  • Hi Corby,

     

    Thanks for your post.

    What I mean to uninstall package from the Experimental Hive is to use the Tools->Extension Manager in Experimental Hive to select that package and uninstall it.

    And all the packages installed in Experimental Hive you can find in the registry location:

    HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0Exp\ExtensionManager\EnabledExtensions

    Hope this can help.

     

     

    Best Regards,

    Ziwei Chen

     

    Monday, September 27, 2010 3:29 AM