473,797 Members | 3,126 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

VS Form-Designer executing form code.

SR
Hi there,
I'm facing a little problem:

I got a class named childBase that inherites from Window.form.
I got another form somewhere that inherites childBase.

I got some code in the childBase_Load event.

My problem is that when I'm trying to design some forms that inherites
from childBase, I got an error and I'm not able to design anything.

The error comes from the fact that VS creates an instance of the form
and then fired the childBase_Load event. The thing is that the code in
that event is not ready to be executed "from" the designer (it's trying
to find some files but in that case it is looking in the c:\progfiles\ms
vs\common7somet hing\ dir, so it fails.)

It should be cool to be able to desable the execution of the code of the
childBase_Load sub when in design mode. There maybe an attribute but I
can't find it.

If you got any ideas ...
--
Sylvain
http://ross.fr/
Jul 21 '05 #1
2 1443
You could check the DesignMode property of the form and only execute if
that is false.

If Not Me.DesignMode Then
'Code here
End If

Just a thought

Jul 21 '05 #2
SR
Thx, works perfectly.

Chris Dunaway wrote:
You could check the DesignMode property of the form and only execute if
that is false.

If Not Me.DesignMode Then
'Code here
End If

Just a thought

Jul 21 '05 #3

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

Similar topics

8
2466
by: alanstew | last post by:
With the body tag calling out 'window onload', a function with a 'window.open' fails at the 'window.open' line. If I cut out the body tag, the function executes as normal. At first I thought it was the entire function failing, but I tested with alerts and found that it was only the 'window.open' that fails to execute. The function is being called by a link, and I suspected some problem with the body alink/vlink but after cutting that out...
29
8784
by: Mic | last post by:
Goal: delay execution of form submit Code (Javascript + JScript ASP): <% Response.Write("<OBJECT ID='IntraLaunch' STYLE='display : none' WIDTH=0 HEIGHT=0 CLASSID='CLSID:0AE533FE-B805-4FD6-8AE1-A619FBEE7A23' CODEBASE='IntraLaunch.CAB#version=5,0,0,3'>") Response.Write("<PARAM NAME='ImageLoc' VALUE='Null'>") Response.Write("<PARAM NAME='ImageSrc' VALUE='Null'>")
0
1548
by: Shawn Hogan | last post by:
Hi everyone, I've been trying to execute a control's private event code via reflection from another class with the goal of potentially doing some unit testing. The examples below are trying to execute button2's click event. This works great when i know the name of the method that i want to invoke. I do so by doing this: Dim AssemblyPointer As Reflection.Assembly
4
1747
by: excelleinc.com | last post by:
Hello, I'm trying to put sub that's shared between all forms in my app in module so when I make change I just change it one time. This sub should execute and then invoke sub defaults() that's different for each form and is contained within the forms. You'll probably ask why don't I just put it in the form after the call to module.function, well it's a handler for one combobox so technically I don't call it.
2
327
by: SR | last post by:
Hi there, I'm facing a little problem: I got a class named childBase that inherites from Window.form. I got another form somewhere that inherites childBase. I got some code in the childBase_Load event. My problem is that when I'm trying to design some forms that inherites from childBase, I got an error and I'm not able to design anything.
1
2024
by: Jon | last post by:
My question is: Can the Garbage Collector (GC) suspended a managed thread while it is executing native code. The reason I am interested in this is that I have: 1) a native thread (N) that only executes native code, 2) a managed thread (M) that sometimes executes native code, 3) a critical section, that is shared by the native code portions of N & M. And I what to know: Can N be suspend by the GC? This would be true if the GC could...
0
1378
by: Ben | last post by:
Hello, I've been developing apps in Delphi for years and have just started writing my first big project in c# + ms .net and have some questions about security and untrusted code. I've got an app that will run on a server on the net that will have plugin capability, where a user could build an assembly that contains a type derived from my base plugin type. I plan to load the plugin assembly at runtime, instanciate the derived type and...
5
1787
by: =?Utf-8?B?cm9nZXJfMjc=?= | last post by:
hey, how do I take form code and put it into separate classes? more specifically, I want to create like a panel class, and put buttons in it and give these buttons click events. and all my form has to show is the empty panel. then tell the panel to inherit from the panel class so it has all those buttons and click events... that way I can make like 10 panel classes, and when I want to display a panel, I just tell it to inherit from one of...
2
2521
by: FrogBunz | last post by:
Is there a way to execute inline javascript code from within an AJAX response? I use AJAX to retrive a JSP page that is loaded using a database bean. One of the form elements is a select that I would like to set based on the database value. I've tried embedding inline script like: <script language="javascript"> document.form1.state.value = "<bean value for state>"; </script> but the code doesn't seem to fire. Any suggestions?
0
9685
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
9536
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10468
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
10245
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...
0
10021
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9063
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
7559
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
5582
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3748
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.