Now we get to another problem with design time every time I change a value on my custom control I have to refresh the control because it gets an error rendering. This only happens when I change a value in the
properties grid.
The specific error is “An unhandled exception has occurred. Object reference not set to an instance of an object”. As soon as I refresh it the control returns to my custom bmp. Any ideas?
Without seeing any code it's hard to imagine what the problem is because a NullReferenceException can happen from a variety of places. The good news is unhandled exceptions should be fairly easy to locate using the debugger. To debug your code in the designer
make sure all your code is saved and built. Open up the project containing your custom control in one instance of visual studio. Open up another instance of visual studio to the project where you're using the control. In the first instance, under debug select
Attach to process and then select the devenv.exe process from the dialog. Now use your control as you would normally in the designer in your other project. It should go to any error lines you encounter and stop at any break points you set up.
I haven't tried this if your control library is in a separate solution, but I *THINK* it will still work.
Mercwrought
Member
231 Points
55 Posts
Must refresh custom control after making a property change
Mar 09, 2006 04:18 PM|LINK
Now we get to another problem with design time every time I change a value on my custom control I have to refresh the control because it gets an error rendering. This only happens when I change a value in the properties grid.
The specific error is “An unhandled exception has occurred. Object reference not set to an instance of an object”. As soon as I refresh it the control returns to my custom bmp. Any ideas?
amn3sia
Member
115 Points
23 Posts
Re: Must refresh custom control after making a property change
Mar 21, 2006 04:58 AM|LINK
I haven't tried this if your control library is in a separate solution, but I *THINK* it will still work.