473,386 Members | 1,668 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,386 software developers and data experts.

Where has UserMode gone in .Net?

In VS 6 there was a UserMode property of the AmbientProperty that told you if you were executing in design mode or run-time. I cannot find this anywhere in .Net 2003. Can anyone tell me where it is or if there is a replacement
Jul 21 '05 #1
2 1482

"Brian Kirk" <Br********@Kaz-group.com> wrote in message
news:CF**********************************@microsof t.com...
In VS 6 there was a UserMode property of the AmbientProperty that told you

if you were executing in design mode or run-time. I cannot find this
anywhere in .Net 2003. Can anyone tell me where it is or if there is a
replacement

The DesignMode property of the System.ComponentModel.Component class is what
you need. All controls (including Forms) inherit directly or indirectly from
this class, so it should work in an form or control.

You need to be careful, though, because you cannot use it in the constructor
of your form or control. This is because the property is actually associated
with the ISite interface, and there is no Site for a control or form while
it is being created. You can accurately check the DesignMode property in the
Load event handler of the Form (or UserControl), so you will need to put
conditional logic there.
Jul 21 '05 #2
Thanks Jeremy, chased that up and it does what I neede

Regard

Brian
Jul 21 '05 #3

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

Similar topics

4
by: Bob Rock | last post by:
Hello, where has the modal frame extended control style (WS_EX_DLGMODALFRAME) gone??? I can't find it among a control's properties. Bob Rock
22
by: ByteSize | last post by:
Dear All, Please, this is not meant to be offensive - but it is a challenge !!! I have posted on over a dozen so called 'vb.net' expert / blog sites - in the vain hope of finding a complete,...
2
by: CoolPint | last post by:
Standard exception classes in C++ have what() which returns const char * and they have constructors accepting string. Where is that string created and when is the string destroyed? In the...
7
by: Muscha | last post by:
My c# application has gone beserk, it consumes 700MB memory griding my machine to a halt. What is the quickest way for me to find out what's happening? Where do all the memory has gone? /m
3
by: Cyrus Donders | last post by:
Hi, We are developing a web application in asp.net and all of a sudden there is this new requirement and I am having problems to implement it. My problem is that when a regular html page posts...
10
by: Stephan Brunner | last post by:
Hi VS 2003 used to have an (Overrides) entry in the left dropdown of the code editor. Where has this handy feature gone in VS 2005?
2
by: Brian Kirk | last post by:
In VS 6 there was a UserMode property of the AmbientProperty that told you if you were executing in design mode or run-time. I cannot find this anywhere in .Net 2003. Can anyone tell me where it is...
7
by: Chris | last post by:
Hello all... I have a program with the following structure (all classes mentioned are of my own creation, and none of the classes contain try or catch blocks): - main() consists of a large...
0
by: Bassam | last post by:
Hello in VS.NET 2003 using VB.NET there was a property for windows forms , SnaptoGrid , True/False and Grid Size where we can set them for individual forms , now those 2 settings are gone from...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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,...
0
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...
0
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,...
0
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...

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.