Does anyone know how to test (with C# code) when the VStudio form designer may be rendering the code? I've got some logging functions that I'd rather not have to keep commenting out whenever I want to revert back to using the form designer.
I also posted this in microsoft.public.vsnet.ide and received an excellent response from Xin Huang who appears to be from Microsoft. This was his reply:
When VS.NET starts editing a component in the designer, the
ComponentDesigner.Initialize method is called by the root designer. This is
the time at which you can tell the component that it is running inside
VS.NET designer by setting an internal flag.
Depending on this flag, you can decide whether to enable the logging
Of course, this requires that you derive a designer for the component. See
for more information about custom designers.
This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. (c) 2002 Microsoft Corporation. All
RMRoy MullerNovember 5, 2002 01:57 PM
It seems the URL from Xin's reply was stripped out of my previous post. Also, the subject matter is a bit intimidating for me right now; I need to re-read the article a few times before I try to subclass my own designer ;-)
Here's the URL that was stripped:
PSPrakash S Syncfusion Team November 12, 2002 10:01 AM
Can you not use the Component.DesignMode property?