473,769 Members | 2,120 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1579
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.co m

"Benny Raymond" <be***@pocketro cks.com> wrote in message
news:%2******** ********@TK2MSF TNGP10.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
2886
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 closing the app. I've tried overriding the closing event > Private Sub frmMain_Closing(ByVal sender As Object, ByVal e As > System.ComponentModel.CancelEventArgs) Handles MyBase.Closing > 'Don't close this form > e.Cancel = True
3
2322
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 later this week. Here's the problem I'm experiencing -- I created several databound controls on a form and when I attempt to debug the application I get 6 errors, 16 warnings -- Warning 1 The variable 'JeopardyDataSet' is either undeclared or...
0
1346
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 inherits from ParentControlDesigner. Just for starters I wanted to try to change the mouse cursor if it fell
11
1804
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 attaching to the process from another visual studio, I can get it to break on some user code with this huge callstack, most of which is native. So are we instantiating something in design mode that we should not be? Does this mean anything to anyone?...
0
9579
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10208
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10038
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9987
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8867
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7404
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5294
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5444
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3558
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.