Designer view goes crazy up after overriding WndProc

  • Thread starter Thread starter Benny Raymond
  • Start date Start date
B

Benny Raymond

Hi, I'm working on an app that has to inherit Form and override WndProc
for several different reasons. Anyway it performs some actions on the
window when WM_CREATE is called. The big problem right now is that the
designer view goes nutz when it opens up because the program doesn't
load the configuration correctly. Is there anything i can do to keep
that block of code from running when in designer view? Perhaps
something like this:
#if !Designer
.... code
#endif

I tried the above and it obviously didn't work ;)

thanks for your help.

~Benny
 
I realized that if I used PostMessage and my own message (wm_user + some
number) durring the wm_create and moved all of my creation code into
that section of the wndproc, it worked while running the program and
never ran when in design mode... not to mention this fixed a couple bugs
with some of the form's items which were setup in wm_create resetting
themselves afterwards.... I moved them all into my own message and
everything's golden

So I'm posting that solution here incase anyone else has a similar problem.

~Benny
 
Benny,

You can just call the DesignMode property on the Control class. It will
return true if you are in design mode, false otherwise.

Hope this helps.
 
Back
Top