Tonny

Dear forum,

I have been developing applications in VB 6 for a number of years, and now want to start using VB with Visual Studio 2005. Doing so, I run into a problem with the Debugger, that is best illustrated through a very simple example :

I create an application with 1 form and with 1 button. Upon clicking the button in the form, it changes its text in a straightforward way:

Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Static i As Integer

Button1.Text = "Pressed " + CStr(i) + " times"

i = i + 1

Button1.Refresh()

End Sub

End Class

I then set a breakpoint at the line "i = i + 1" and start the debugger. It creates Form1 and in it the button with text "Button1". When I click the button, the execution stops at the breakpoint, as expected. However, the button text still says "Button1". Even if I step past the Button1.Refresh() command, the button still shows the "Button1" text. Only upon exiting the Sub, my Button text gets correctly updated.

Such a behaviour was not found in VB 6, where the debugger resulted in immediate updates of the forms I built.

Any suggestion on how I can get back to the VB 6 debugger behaviour

I apologize if this question has been asked already before.

Best regards,

Tonny



Re: Visual Studio Debugger Visual Studio 2005 debugger - forms don't get updated

JimGries - MSFT

Hi Tony,

I believe the reason that your control is not repainting after stepping over the Refresh is due to the fact that while stopped at a breakpoint your application is not able to respond to the Paint message that Refresh causes to occur. While I'm not an expert on VB6, that product had a very different model for both how it's application runtime worked (the VB runtime vs the new .NET runtime) and also how debugging was implemented.

That being said, there is a method to achieve what you desire. It's a bit more work and a little strange, but it may be useful to you. http://blogs.msdn.com/jmstall/archive/2005/12/07/funceval_message_pump.aspx

Jim






Re: Visual Studio Debugger Visual Studio 2005 debugger - forms don't get updated

Tonny

Thanks Jim, that solves the issue !