none
Display a message in the status bar from an add-in RRS feed

  • Question

  • Hello,

     

    My add-in is performing an long operation, and if the user tries to do something else during that time, Visual Studio may crash. So I would like to display a message in the status bar instead of 'Ready' to explain what it's doing.

     

    According to that page, I need to get a service to control the status bar.

     

    That page from MZ-Tools explains the operation from a VB add-in; I tried to apply the same logic in C# but I get null when casting _applicationObject to IServiceProvider...

     

    So how can I get a service from an add-in in C#? Or is there another solution to inform the user and prevent him from doing any action?

    Tuesday, February 19, 2008 2:44 PM

Answers

  • If you are creating an add-in, then you don't really need a service for that since the automation model (EnvDTE) already provides the EnvDTE.StatusBar class that you can retrieve with DTE.StatusBar.

    Wednesday, February 20, 2008 10:15 AM
    Moderator

All replies

  • If you are creating an add-in, then you don't really need a service for that since the automation model (EnvDTE) already provides the EnvDTE.StatusBar class that you can retrieve with DTE.StatusBar.

    Wednesday, February 20, 2008 10:15 AM
    Moderator
  • Thank you very much

     

    Is there a way to prevent any action on Visual Studio during the execution of the add-in? (like a message box with a progress bar or something)

    Wednesday, February 20, 2008 3:58 PM
  •  

    The statusbar of VS can show a progressbar or animated picture. Also, I think that as long as you do NOT use multithreading or yield control with Application.DoEvents, VS will prevent any other action while your add-in is processing.
    Thursday, February 21, 2008 3:49 PM
    Moderator