Control.DesignMode issues.
Mike Andrews <[email protected]> Thu, 13 Dec 2007 07:57:31 -0600
| Newsgroups | gmane.comp.windows.devel.dotnet.winforms |
|---|---|
| Message-ID | <[email protected]> |
I'm having a particular issue with designing controls that I'm guessing I either didn't understand properly or there's something else going on. The current project on which I'm working has numerous usercontrols. Some of these usercontrols contain other composite usercontrols. Additionally, some of these controls derive their data from a database automatically. Now, in order to design these controls, the Control.DesignMode property was used to prevent code from executing when designing the control. The problem I'm having now is that when I draw one of those controls on the design surface of another usercontrol that DesignMode property is returning false for the drawn control even though I'm currently in design mode for the control I'm currently building. I thought (or assumed) that the Control.DesignMode chained down through the various child controls so that each control would know that its parent or its parent's parent was in design mode. Apparently I was mistaken. Has anyone else experienced this or know what's going on here or any suggestions on how to overcome this one? Thanks, Mike