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 [DesignTimeVisib le(false)] but this gives me an compile error:
"Attribute 'DesignTimeVisi ble' is not valid on this declaration type. It is
valid on 'class, interface' declarations only."
Help is appreciated
Lucas 4 3932
[Browsable( false )] ??
Maybe?
4Space
"Lucas Sain" <ls***@lidersof t.com> wrote in message
news:eN******** ******@TK2MSFTN GP09.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 [DesignTimeVisib le(false)] but this gives me an compile error: "Attribute 'DesignTimeVisi ble' is not valid on this declaration type. It
is valid on 'class, interface' declarations only."
Help is appreciated
Lucas
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.co m
"Lucas Sain" <ls***@lidersof t.com> wrote in message
news:eN******** ******@TK2MSFTN GP09.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 [DesignTimeVisib le(false)] but this gives me an compile error: "Attribute 'DesignTimeVisi ble' is not valid on this declaration type. It
is valid on 'class, interface' declarations only."
Help is appreciated
Lucas
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.c om> wrote in
message news:eQ******** ******@TK2MSFTN GP11.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.co m
"Lucas Sain" <ls***@lidersof t.com> wrote in message news:eN******** ******@TK2MSFTN GP09.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 [DesignTimeVisib le(false)] but this gives me an compile error: "Attribute 'DesignTimeVisi ble' is not valid on this declaration type. It is valid on 'class, interface' declarations only."
Help is appreciated
Lucas
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.c om... [Browsable( false )] ??
Maybe?
4Space
"Lucas Sain" <ls***@lidersof t.com> wrote in message news:eN******** ******@TK2MSFTN GP09.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 [DesignTimeVisib le(false)] but this gives me an compile error: "Attribute 'DesignTimeVisi ble' is not valid on this declaration type. It is valid on 'class, interface' declarations only."
Help is appreciated
Lucas
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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, share your experience in using IDENTITY as PK .
|
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 the properties window the delete key usually sets the
Image to nothing, but when I tried this with my new
property it did not work.
I have a feeling something needs to be added to the
property statement in order to accept Nothing for any
|
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 every where I can think and I can not find the
solution. The closest I can come is to implement IBindingList or
IListSource to expose a list for the DataSource property on controls. This
works great for controls like a list box but doesn't work...
|
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 unable to add any custom
properties to the control.
Eg,
private string stringProp = null;
|
by: Shimon Sim |
last post by:
I have a custom composite control
I have following property
| |
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 is used to view the state of the running
jobs and schedule new jobs. The control also runs in the context of
Internet Explorer (we do this so the administrators of the jobs can always
receive the latest control). The property grid is used to...
|
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
Me.Height = 16
|
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.
Private Sub Top25_Click()
Dim strSQL As String
strTblName = "tblNew_" & Format(Date, "ddmmmyyyy")
strSQL = "SELECT TOP 25 tblOld.Fname, tblOld.Lname INTO " &
|
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... fred will appear as the Name of Button1, however,
the handler for Button1 works still works as well...
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
|
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,...
|
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...
| |
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...
|
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,...
|
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...
|
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...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |