locked
how to dynamically change the icon of the toolbar button RRS feed

  • Question

  • Hi,

    I want to dynamically change the icon of the toolbar button. I know it's possible to dynamically change the text. But how about the icon? I'm using ctc right now. If it's not possible with ctc, how about vsct?


    Regards,
    Haibin
    Monday, December 3, 2007 7:24 AM

Answers

  • The icons are actually embedded in the resource at the time you run /setup for devenv, so you would not be able to change these icons dynamically.  The simplest way to work around this would probably be to have different buttons and hide/show them depending on your status.

     

    Otherwise, you would have to implement your own control.  Are you looking to do something similar to how the SingleViewEditor sample handles its font changes? 

     

    Wednesday, December 5, 2007 8:49 PM

All replies

  • The icons are actually embedded in the resource at the time you run /setup for devenv, so you would not be able to change these icons dynamically.  The simplest way to work around this would probably be to have different buttons and hide/show them depending on your status.

     

    Otherwise, you would have to implement your own control.  Are you looking to do something similar to how the SingleViewEditor sample handles its font changes? 

     

    Wednesday, December 5, 2007 8:49 PM
  • Thanks for your reply. I have my icons as image files in a folder and was thinking of dynamically making a toolbar button given a image file name from a server. Since it's not possible, I got to define the toolbar buttons in ctc file beforehand.
    Friday, December 7, 2007 3:39 AM