473,796 Members | 2,740 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Property's Description and Category do not work


All,

I created a control that have the following property defined:

private bool autoSearch
[
DefaultValue(ty peof(bool),true ),
Description("Au to search upon typing"),
Category("Behav ior")
]
My control is compiled and created fine. But, after adding the control to
my form, I noticed the following problems:

1. The autoSearch property does not show up in the Behavior category.
Instead, it's shown in the Misc. category.
2. The Decription does not show up at all. I can see the autoSearch
property. I can change its value from true to false. But when I clicked on
the autoSearch, its desciption does not show up.

Can someone shed a light on this?

Thanks.
Nov 15 '05 #1
5 6140
100
Hi David,
You should specify attributes before the names they apply to:
[ DefaultValue(ty peof(bool),true ),
Description("Au to search upon typing"),
Category("Behav ior")]
private bool autoSearch

HTH
B\rgds
100


" David N" <dq*****@netiq. com> wrote in message
news:uq******** ******@tk2msftn gp13.phx.gbl...

All,

I created a control that have the following property defined:

private bool autoSearch
[
DefaultValue(ty peof(bool),true ),
Description("Au to search upon typing"),
Category("Behav ior")
]
My control is compiled and created fine. But, after adding the control to
my form, I noticed the following problems:

1. The autoSearch property does not show up in the Behavior category.
Instead, it's shown in the Misc. category.
2. The Decription does not show up at all. I can see the autoSearch
property. I can change its value from true to false. But when I clicked on the autoSearch, its desciption does not show up.

Can someone shed a light on this?

Thanks.

Nov 15 '05 #2

"100" <10*@100.com> wrote in message
news:%2******** *******@TK2MSFT NGP10.phx.gbl.. .
Hi David,
You should specify attributes before the names they apply to:
[ DefaultValue(ty peof(bool),true ),
Description("Au to search upon typing"),
Category("Behav ior")]
private bool autoSearch

HTH
B\rgds
100


" David N" <dq*****@netiq. com> wrote in message
news:uq******** ******@tk2msftn gp13.phx.gbl...

All,

I created a control that have the following property defined:

private bool autoSearch
[
DefaultValue(ty peof(bool),true ),
Description("Au to search upon typing"),
Category("Behav ior")
]
My control is compiled and created fine. But, after adding the control to my form, I noticed the following problems:

1. The autoSearch property does not show up in the Behavior category.
Instead, it's shown in the Misc. category.
2. The Decription does not show up at all. I can see the autoSearch
property. I can change its value from true to false. But when I
clicked on
the autoSearch, its desciption does not show up.

Can someone shed a light on this?

Thanks.


Nov 15 '05 #3
Sorry for all blank replies. My machine was out of memory and when I press
enter key, some how the message dialog was closed and the message was
sent....

Anh thank you for your reply. I swapped the attributes on top of the
property, but the result is the same. Beside, I don't think the position
makes the different, because I have another property of type string, and the
default value of each property was shown correctly...

"100" <10*@100.com> wrote in message
news:%2******** *******@TK2MSFT NGP10.phx.gbl.. .
Hi David,
You should specify attributes before the names they apply to:
[ DefaultValue(ty peof(bool),true ),
Description("Au to search upon typing"),
Category("Behav ior")]
private bool autoSearch

HTH
B\rgds
100


" David N" <dq*****@netiq. com> wrote in message
news:uq******** ******@tk2msftn gp13.phx.gbl...

All,

I created a control that have the following property defined:

private bool autoSearch
[
DefaultValue(ty peof(bool),true ),
Description("Au to search upon typing"),
Category("Behav ior")
]
My control is compiled and created fine. But, after adding the control to my form, I noticed the following problems:

1. The autoSearch property does not show up in the Behavior category.
Instead, it's shown in the Misc. category.
2. The Decription does not show up at all. I can see the autoSearch
property. I can change its value from true to false. But when I
clicked on
the autoSearch, its desciption does not show up.

Can someone shed a light on this?

Thanks.


Nov 15 '05 #4
My fault!
The attribute declaration does have to be before the property {get/set}
pair. I have to close the solution and reopen it in order to see the
change.

Thanks a lot.

" David N" <dq*****@netiq. com> wrote in message
news:uq******** ******@tk2msftn gp13.phx.gbl...

All,

I created a control that have the following property defined:

private bool autoSearch
[
DefaultValue(ty peof(bool),true ),
Description("Au to search upon typing"),
Category("Behav ior")
]
My control is compiled and created fine. But, after adding the control to
my form, I noticed the following problems:

1. The autoSearch property does not show up in the Behavior category.
Instead, it's shown in the Misc. category.
2. The Decription does not show up at all. I can see the autoSearch
property. I can change its value from true to false. But when I clicked on the autoSearch, its desciption does not show up.

Can someone shed a light on this?

Thanks.

Nov 15 '05 #5
100
Hi David,
I'm glad that you managed to solve your problem. I just want to point you on
the fact that the position of the attribute declaration *does* matter.
Attributes are applied on the declaration that follows the place where the
attribute is specified. If there is ambiguity or your intent is different
than what is the default target an "atribute target specifier" can be used.

So in your example
private bool autoSearch
[
DefaultValue(ty peof(bool),true ),
Description("Au to search upon typing"),
Category("Behav ior")
]

The attributes will be applied to what follows.

And if your code looks like this:

private bool autoSearch
[
DefaultValue(ty peof(bool),true ),
Description("Au to search upon typing"),
Category("Behav ior")
]
public bool Foo()
{
......
}

The attribute is going to be applied to Foo method rather than autoSearch
member.

The attribute declaration does have to be before the property {get/set}
pair. I don't realy understand what *before {get/set} pair* means.
If you have:

bool Prop
[SomeAttribute]
{
get{}
set{}
}

It is a syntax error and this won't compile.
----------------------------------------
[SomeAttribute]
bool Prop
{
get{}
set{}
}

You apply the attribute to the property.
-----------------------------------------
bool Prop
{

[SomeAttribute]
get{}
set{}
}

I this case by default the attribute will be applied to the *get* method.
You can apply the attribute to the returning value using *return* target
specifier. Anyway, the property Prop itself won't have attribute applied.
-------------------------------------------
bool Prop
{
get{}

[SomeAttribute]
set{}
}
By default you apply the atribute to the *set* method. You can apply the
attribute to the *value* parameter via specifying *param* target. As in the
previous case the property itself won't have attribute applied.

So the position of the attributes *does* matter.

B\rgds
100
" David N" <dq*****@netiq. com> wrote in message
news:uq******** ******@tk2msftn gp13.phx.gbl...

All,

I created a control that have the following property defined:

private bool autoSearch
[
DefaultValue(ty peof(bool),true ),
Description("Au to search upon typing"),
Category("Behav ior")
]
My control is compiled and created fine. But, after adding the control to my form, I noticed the following problems:

1. The autoSearch property does not show up in the Behavior category.
Instead, it's shown in the Misc. category.
2. The Decription does not show up at all. I can see the autoSearch
property. I can change its value from true to false. But when I
clicked on
the autoSearch, its desciption does not show up.

Can someone shed a light on this?

Thanks.


Nov 15 '05 #6

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

Similar topics

2
6165
by: Todd | last post by:
Hello, I'm curious if anyone knows of a way (if one exists) to tell a form (in Access 2002 VBA) to sort on an unbound column of a combo box on the form. Here's what I want to do: A combo box on my form contains a category ID (bound column, not visible, long integer) for the items listed on the form and a description (unbound column, visible, string.) I can "Sort Ascending" and "Sort Descending" on the visible description in the...
2
3416
by: Steve Teeples | last post by:
Someone introduced me to PropertyGrid last night. It is a great feature for what I need. A question though. I noticed that when I assign a "TextBox" control to a property grid the description on each property is shown at the bottom of the grid. Also, properties are divided into categories. How can I do this with my own defined objects? For example: I would like Name to be in one category with a description for it and Days to be in...
2
3021
by: steve bull | last post by:
I have created a label control and got it to appear in the toolbox. The problem I have is that while all the other properties appear for the contro I can't get the Text property to appear at all. I have tried in both the DataBindings category and the Appearance category but it won't appear in either. Am I missing something or do I have to do something extra for the Text property? I have included the part of the code which seems relevant....
9
1529
by: Alphonse Giambrone | last post by:
I have built a simple composite control that consists of a textbox, requiredfieldvalidator and rangevalidator. For properties that are unique to the individual control, I set/get them directly from the control as follows: public string Text { get {
0
5569
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...
2
4840
by: Lance | last post by:
I want to be able to reset a complex property in a PropertyGrid. I know that for properties that are ValueTypes you can include System.ComponentModel.DefaultValue in the declaration of the property. But, for complex property types (e.g., instance types) this does not work because System.ComponentModel.DefaultValue requires a constant value In order to indicate if a property should be serialized you can include a boolean function named...
7
4451
by: Andrea Moro | last post by:
I'm writing my first windows control library. A simple textbox with some numeric facilities. Well, there is a strange thing that happen. I want to add a locked property. As many other property, because it's a default property, I must shadow it, but unfortunately, despite the other properties shadowed, for instance tabindex, locked continue to stay in design category also if I set it up to behaviour, and doesn't run my own code.
2
2404
by: Rolf Welskes | last post by:
Hello, I have writen a simple aspnet control MyCtrl and want to use it as follows: (c01 may be the tag-prefix): <c01:MyCtrl>this is a simple text</c01:MyCtrl>. The control-code:
2
2033
by: Lespaul36 | last post by:
I have a control that I have made that uses a custom class for storage of some of the information. I want it to display in the VS.Net 2003 property grid in the IDE like the Font property does, so a use can expand it and set the properties. How do I do this? Thanks in advance.
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
10467
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
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
9061
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...
0
6802
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();...
0
5582
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4130
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3744
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2931
bsmnconsultancy
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...

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.