Debugging Custom Controls: How do I set break-points & step through code? (VB)

Omid Golban

Member
Joined
Jun 3, 2003
Messages
6
Debugging Custom Controls: How do I set break-points & step through code?

Hello,

I have created a custom control that inherits from TextBox. I have created a couple of properties. Then I used this new control in my form. When I try to set the property, Im getting errors. I want to put a break point & step through the code. I went ahead & put a break-point in my custom controls propertys Set where I want to start the debugging, Then I went back to design view of my form & tried to enter a value in the property in question. the code never stopped. I entered a message box where I want to start debugging, and the message does pop up. So I know the code is executing. How do I step through this code & examin value of its local variables?

Thanks,
Omid
 
Debugging controls at design time is extremely tedious. You have to open a new instance of Visual Studio and attach its debugger to the first instance, which is the one running your control. You can then set the second instance up to break on CLR exceptions (Debug menu -> Exceptions) and when the exception is his in the first one, the second one will break in to source code.
 
Back
Top