Editing code in Visual Studio 2008 in debug mode

后端 未结 7 704
别跟我提以往
别跟我提以往 2021-02-04 07:12

I am curious to know if there is a way to edit code in C# VS 2008 right when it has hit a breakpoint and I am walking thru the code... can I modify the code (such as the value i

7条回答
  •  甜味超标
    2021-02-04 07:53

    To modify the value of a variable or set a property while in break mode go to the Immediate window, set the new value, and hit return e.g.

    strValue = "newValue"
    Calendar1.Enabled = true
    

    To retrieve a value you can just print it to the window e.e.

    ?strValue
    ?Calendar1.Enabled
    

提交回复
热议问题