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

Is there a design-time flag?

If a public property is Browsable,it will appear in vs.net 's designer's
property window.and the code in that property will be run either.But I don't
want the code to be run at design-time.Is there a design-time flag,so the
code can be skip at design-time? like

if not #design-time then
..........
..........
end if

Thanks.
Nov 18 '05 #1
2 938
Unfortunatly, there doesn't seem to be one.

One way I have seen it done, and what seems to work for me, is to check if
Context is null (Nothing in VB.NET)

if (Context != null )
// Do this

If (Not Context Is Nothing) Then
' Do that
End If
Brian W

"popman" <ne****@sohu.com> wrote in message
news:u8*************@TK2MSFTNGP12.phx.gbl...
If a public property is Browsable,it will appear in vs.net 's designer's
property window.and the code in that property will be run either.But I don't want the code to be run at design-time.Is there a design-time flag,so the
code can be skip at design-time? like

if not #design-time then
.........
.........
end if

Thanks.

Nov 18 '05 #2
popman wrote:
If a public property is Browsable,it will appear in vs.net 's designer's
property window.and the code in that property will be run either.But I don't
want the code to be run at design-time.Is there a design-time flag,so the
code can be skip at design-time? like

if not #design-time then
.........
.........
end if


// in C#...
if ((this.Site != null) && (this.Site.DesignMode)) {
// we're in design mode
}

See:

http://msdn.microsoft.com/msdnmag/is...e/default.aspx

for more details.

--
mikeb
Nov 18 '05 #3

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

Similar topics

3
by: zlst | last post by:
Many technological innovations rely upon User Interface Design to elevate their technical complexity to a usable product. Technology alone may not win user acceptance and subsequent marketability....
0
by: zlst | last post by:
Many technological innovations rely upon User Interface Design to elevate their technical complexity to a usable product. Technology alone may not win user acceptance and subsequent marketability....
3
by: zlst | last post by:
Many technological innovations rely upon User Interface Design to elevate their technical complexity to a usable product. Technology alone may not win user acceptance and subsequent marketability....
0
by: zlst | last post by:
Many technological innovations rely upon User Interface Design to elevate their technical complexity to a usable product. Technology alone may not win user acceptance and subsequent marketability....
3
by: zlst | last post by:
Many technological innovations rely upon User Interface Design to elevate their technical complexity to a usable product. Technology alone may not win user acceptance and subsequent marketability....
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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?

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.