Paul,
You can debug the design time:
1. Open the VS studio and load your project. I'll call it VS1
2. Open a new VS instance and create a new test project where you are going
to use your new control. I'll call this VS2
3. In VS1 set break points on the method(s) you want to debug
4. In VS1 from the Debug menu chose "Attach to Process..." command
5. In the dialog box find the process for VS2 (it is called devenv BTW; it
shows also the caption bar text so you can find it easily)
6. Attach to VS2 process
7. Start using VS2 - add the control to a form, remove it from a form, etc.
VS one will stop on the brak points and you will be able to debug your
probelem.
FYI there are more than one way how to do the debugging basically the goal
is the same to start another instance of VS and attach to its process.
Personally I found the steps I gave you the most convinient to use.
--
HTH
Stoitcho Goutsev (100)
"Paul Cheetham" <PA******@dsl.pipex.com> wrote in message
news:eh**************@tk2msftngp13.phx.gbl...
Hi,
I have created a custom button control, descended from ButtonBase, which
implements custom drawing etc.
Everything works fine, until I try to delete the button from the form in
the designer. At this point I get the message 'Object Reference not set to
an Instance of an Object'
My Dispose function is very simple, as it just deletes a bitmap object
(after checking it is not null) and then calls base.Dispose()
I know what the error means, but because it is occurring while in design
mode, I don't know how to find out what's causing it.
Can anyone suggest something to look for, or any events that might be
fired while the object is being disposed of, or even a way to debug it in
design mode?
Can anyone tell me where and when the Disposing flag gets set?
I am using c# in VS 2003 and .Net 1.1
Thankyou.
Paul