none
VS style Object Watch Window RRS feed

  • Question

  • I would like to watch and interact with a object during runtime in my WinForm App.

    How do I embed a VS watch windows in my WinForm App? Is there for a control for this?


    -SD

    Friday, November 15, 2013 12:42 AM

Answers

  • The VS watch window is not something you can embed in your own application.  It requires a debugger which you don't have.  However you can add a PropertyGrid to your app.  You can then assign instances of objects you want to "watch" to the grid to display the properties.  The instances would need to be global or otherwise accessible from the grid.  You will not be able to look at local variables, parameters, etc as they don't live long enough but global app objects should be fine.  You need to be very careful about this though as it opens up your data for modification.  It should not be used to debug your application as VS and/or logging can be used instead.

    Michael Taylor
    http://msmvps.com/blogs/p3net

    Monday, November 18, 2013 8:09 PM
    Moderator

All replies

  • Hello,

    If I understand correctly, you want to use the Watch Window to watch and interact with an object during runtime.

    For this, to open the Watch window, the debugger must be running or in break mode. From the Debug menu, choose Windows, then Watch, and click on Watch1, Watch2, Watch3, or Watch4. And then you can see the detail information for the object.

    More information regards it:

    http://msdn.microsoft.com/en-us/library/aa290869(v=vs.71).aspx

    Regards.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, November 18, 2013 6:10 AM
    Moderator
  • The VS watch window is not something you can embed in your own application.  It requires a debugger which you don't have.  However you can add a PropertyGrid to your app.  You can then assign instances of objects you want to "watch" to the grid to display the properties.  The instances would need to be global or otherwise accessible from the grid.  You will not be able to look at local variables, parameters, etc as they don't live long enough but global app objects should be fine.  You need to be very careful about this though as it opens up your data for modification.  It should not be used to debug your application as VS and/or logging can be used instead.

    Michael Taylor
    http://msmvps.com/blogs/p3net

    Monday, November 18, 2013 8:09 PM
    Moderator