Omid Golban Posted June 4, 2003 Posted June 4, 2003 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, I'm getting errors. I want to put a break point & step through the code. I went ahead & put a break-point in my custom control's property's 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 Quote
*Gurus* divil Posted June 4, 2003 *Gurus* Posted June 4, 2003 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. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.