473,322 Members | 1,493 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Designer view goes crazy up after overriding WndProc

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
Nov 17 '05 #1
2 1561
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 Raymond wrote:
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

Nov 17 '05 #2
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.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Benny Raymond" <be***@pocketrocks.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
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

Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Phuff | last post by:
I have an application that should run in the system tray while open. It is supposed to be open at all times and I need it to dissapear when the "X" button is pushed on the form...but without...
3
by: Crazy Cat | last post by:
Hi, I'm developing an application that is basically a VB.NET front end to a SQL Server Express 2005 database -- right now I'm using VB.NET 2005 Express until my MSDN subscription gets delivered...
0
by: Andy Wynn | last post by:
Hello All, I've got a custom control ( Panel-like, but not inheriting from Panel) that has a header region that's custom drawn. Custom Control is using a custom controldesigner class that...
11
by: Tom C | last post by:
We have a window named FormApplication which just happens to be our mid parent window. When I open it in the designer, it is stuck in a loop redisplaying a c1flexgrid. maxing out our cpu's. By...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.