GUI does not redraw while stepping in Debug Mode

后端 未结 3 418
心在旅途
心在旅途 2021-01-21 16:37

In any .NET 2.0 Winforms application, if you run the code in Debug Mode, and you either hit a breakpoint or otherwise Step Into the code line by line, and you want to see the GU

3条回答
  •  渐次进展
    2021-01-21 17:22

    The reason for this is because you can only have one UI thread, and when you enter your method that updates that code that code begins blocking the UI thread. It will not update until your method exits.

    Here is a good SO on message pumps, which are what drive the UI updates

    You should be able to use Add Watch/Quick Watch to look at any values at the time of debugging. This sounds like what you are really looking for, anyway.

提交回复
热议问题