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

how do I make a property only modifiable by code and not design time?

Hi,

How do I make a property only modifiable by code and not design time. I
have a property that should only be modifieable by code and not design time,
What attribute should I use?
I tried [DesignTimeVisible(false)] but this gives me an compile error:
"Attribute 'DesignTimeVisible' is not valid on this declaration type. It is
valid on 'class, interface' declarations only."

Help is appreciated

Lucas

Nov 15 '05 #1
4 3915
[Browsable( false )] ??

Maybe?

4Space

"Lucas Sain" <ls***@lidersoft.com> wrote in message
news:eN**************@TK2MSFTNGP09.phx.gbl...
Hi,

How do I make a property only modifiable by code and not design time. I
have a property that should only be modifieable by code and not design time, What attribute should I use?
I tried [DesignTimeVisible(false)] but this gives me an compile error:
"Attribute 'DesignTimeVisible' is not valid on this declaration type. It is valid on 'class, interface' declarations only."

Help is appreciated

Lucas

Nov 15 '05 #2
Lucas,

You will want to apply the Browsable attribute to your property, with a
value of false, to indicate that designers shouldn't modify it, like so:

[Browsable(false)]
public string MyProperty
{
get
{
}
set
{
}
}

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Lucas Sain" <ls***@lidersoft.com> wrote in message
news:eN**************@TK2MSFTNGP09.phx.gbl...
Hi,

How do I make a property only modifiable by code and not design time. I
have a property that should only be modifieable by code and not design time, What attribute should I use?
I tried [DesignTimeVisible(false)] but this gives me an compile error:
"Attribute 'DesignTimeVisible' is not valid on this declaration type. It is valid on 'class, interface' declarations only."

Help is appreciated

Lucas

Nov 15 '05 #3
Thanks,

That did the job.
Do you know how to make a code in an event not execute in design time. I
have a Baseform that has X code in the event "VisibleChanged". All my forms
inherit from this form. The code in this event always gets executed in
design time, how do I avoid this??

Regards
Lucas

Reagrds
Lucas
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:eQ**************@TK2MSFTNGP11.phx.gbl...
Lucas,

You will want to apply the Browsable attribute to your property, with a value of false, to indicate that designers shouldn't modify it, like so:

[Browsable(false)]
public string MyProperty
{
get
{
}
set
{
}
}

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Lucas Sain" <ls***@lidersoft.com> wrote in message
news:eN**************@TK2MSFTNGP09.phx.gbl...
Hi,

How do I make a property only modifiable by code and not design time. I have a property that should only be modifieable by code and not design

time,
What attribute should I use?
I tried [DesignTimeVisible(false)] but this gives me an compile error:
"Attribute 'DesignTimeVisible' is not valid on this declaration type. It

is
valid on 'class, interface' declarations only."

Help is appreciated

Lucas


Nov 15 '05 #4
Thanks,

That did the job.
Do you know how to make a code in an event not execute in design time. I
have a Baseform that has X code in the event "VisibleChanged". All my forms
inherit from this form. The code in this event always gets executed in
design time, how do I avoid this??

Regards
Lucas

"4Space" <4S****@NoSpam.com> wrote in message
news:lz**********************@news.easynews.com...
[Browsable( false )] ??

Maybe?

4Space

"Lucas Sain" <ls***@lidersoft.com> wrote in message
news:eN**************@TK2MSFTNGP09.phx.gbl...
Hi,

How do I make a property only modifiable by code and not design time. I have a property that should only be modifieable by code and not design

time,
What attribute should I use?
I tried [DesignTimeVisible(false)] but this gives me an compile error:
"Attribute 'DesignTimeVisible' is not valid on this declaration type. It

is
valid on 'class, interface' declarations only."

Help is appreciated

Lucas


Nov 15 '05 #5

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

Similar topics

112
by: Andy | last post by:
Hi All! We are doing new development for SQL Server 2000 and also moving from SQL 7.0 to SQL Server 2000. What are cons and pros for using IDENTITY property as PK in SQL SERVER 2000? Please,...
0
by: Ivan D. | last post by:
I am making a User Control in visual basic, it contains a Picture Box. To allow the image to change at design time I added a property. When changing a *normal* PictureBox Image at design time in...
0
by: Jason | last post by:
What interface do I need to implement in order to get a component with a public property to show up in the data binding drop down boxes at design time in VS.net? I've tried to look just about...
0
by: scpedicini | last post by:
Okay, I've been having a problem with custom design-time properties that has been driving me nuts for about a week. The control that I'm working on extends System.Windows.Forms.AxHost, but I'm...
7
by: Shimon Sim | last post by:
I have a custom composite control I have following property
0
by: Brian Young | last post by:
Hi all. I'm using the Property Grid control in a control to manage a windows service we have developed here. The windows service runs a set of other jobs that need to be managed. The control...
8
by: Jordi Rico | last post by:
Hi, I've made the next inherited class in Visual Studio 2005: Public Class LabelEx Inherits System.Windows.Forms.Label Sub New() MyBase.New() Me.ForeColor = Color.Black Me.AutoSize = False...
3
by: u473 | last post by:
How do I call a reusable report with a modifiable Rowsource property and or code ? Like in the following case where the table name will change any following day ? I am using Access 2003. ...
10
by: Rob | last post by:
I am reading a book that says that the "name" property can be altered only at design time and cannot be modified at runtime. Please explain this given the code below... If you click Button3......
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
0
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...
0
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,...
0
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...

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.