Home All Groups Group Topic Archive Search About
Author
26 Oct 2006 1:41 AM
Esha
I'm learning Attribute stuff by reading MSDN topics. I'm creating a new
Property for Custom Control. I'm trying to add an Attribute to the Property
this way:
<Category("Alignment"), Description("Specifies the alignment of text.")> _

Public Property MyProperty() As String

I copied the Attribute line from MSDN topic.

VS highlights Category and Description and says "Type 'Category' is not
defined". The same for Description.

I tried to add

Imports System

Imports System.Attribute

No success.

What am I missing?

What should I add and where in order to make the Attribute line work?

Thank you

Author
26 Oct 2006 3:01 AM
Bryan Phillips
Add this import too:

Imports System.ComponentModel

Bryan Phillips
MCSD, MCDBA, MCSE
Blog:  http://bphillips76.spaces.live.com




Show quoteHide quote
"Esha" <a**@optonline.net> wrote in message
news:#uBpZ$J#GHA.3312@TK2MSFTNGP02.phx.gbl:

> I'm learning Attribute stuff by reading MSDN topics. I'm creating a new
> Property for Custom Control. I'm trying to add an Attribute to the Property
> this way:
> <Category("Alignment"), Description("Specifies the alignment of text.")> _
>
> Public Property MyProperty() As String
>
> I copied the Attribute line from MSDN topic.
>
> VS highlights Category and Description and says "Type 'Category' is not
> defined". The same for Description.
>
> I tried to add
>
> Imports System
>
> Imports System.Attribute
>
> No success.
>
> What am I missing?
>
> What should I add and where in order to make the Attribute line work?
>
> Thank you
Author
26 Oct 2006 12:04 PM
Esha
Thanks a lot Bryan

Show quoteHide quote
"Bryan Phillips" <bphillips@nospam.crowechizek.com.spammenot> wrote in
message news:%239epZrK%23GHA.1784@TK2MSFTNGP04.phx.gbl...
> Add this import too:
>
> Imports System.ComponentModel
>
> Bryan Phillips
> MCSD, MCDBA, MCSE
> Blog:  http://bphillips76.spaces.live.com
>
>
>
>
> "Esha" <a**@optonline.net> wrote in message
> news:#uBpZ$J#GHA.3312@TK2MSFTNGP02.phx.gbl:
>
>> I'm learning Attribute stuff by reading MSDN topics. I'm creating a new
>> Property for Custom Control. I'm trying to add an Attribute to the
>> Property
>> this way:
>> <Category("Alignment"), Description("Specifies the alignment of text.")>
>> _
>>
>> Public Property MyProperty() As String
>>
>> I copied the Attribute line from MSDN topic.
>>
>> VS highlights Category and Description and says "Type 'Category' is not
>> defined". The same for Description.
>>
>> I tried to add
>>
>> Imports System
>>
>> Imports System.Attribute
>>
>> No success.
>>
>> What am I missing?
>>
>> What should I add and where in order to make the Attribute line work?
>>
>> Thank you
>