Groups | Blog | Home
all groups > asp.net building controls > march 2005 >

asp.net building controls : Description of property



simon
3/4/2005 9:32:25 AM
I have simple question.

I build user control with property:

Public Property clickFill() As Boolean

Get
Return _clickFill
End Get

Set(ByVal Value As Boolean)
_clickFill =3D Value
End Set

End Property

Where in this code I put the description of property, which user see on =
code behind when use this user control?

And I have another question.

How can I convert this user control into regular control, like =
<asp:listBox> for example?
Not ascx file but dll file. Is that very complicated? Any example?

The problem is if I want to send someone this control, the person also =
see all the code, which is included in user control ascx file.

Thank you for your answer,

recoil NO[at]SPAM community.nospam
3/5/2005 5:19:37 AM
<Bindable(true), Category("My Custom Category"), Description("When this
is set to true you can click anywhere to fill")>
Public Property clickFill() As Boolean


Get
Return _clickFill
End Get


Set(ByVal Value As Boolean)
_clickFill = Value
End Set


Try the above code for VB.NET. If you get any compilation errors make
sure that you are inheriting the proper namespaces. I think
System.ComponentModel is necessary. Look up the class Attributes that I
use and add the word Attribute in the MSDN. e.g. DescriptionAttrribute,
etc


End Property
recoil NO[at]SPAM community.nospam
3/5/2005 5:19:38 AM
<Bindable(true), Category("My Custom Category"), Description("When this
is set to true you can click anywhere to fill")>
Public Property clickFill() As Boolean


Get
Return _clickFill
End Get


Set(ByVal Value As Boolean)
_clickFill = Value
End Set


Try the above code for VB.NET. If you get any compilation errors make
sure that you are inheriting the proper namespaces. I think
System.ComponentModel is necessary. Look up the class Attributes that I
use and add the word Attribute in the MSDN. e.g. DescriptionAttrribute,
etc


End Property
recoil NO[at]SPAM community.nospam
3/5/2005 5:19:42 AM
<Bindable(true), Category("My Custom Category"), Description("When this
is set to true you can click anywhere to fill")>
Public Property clickFill() As Boolean


Get
Return _clickFill
End Get


Set(ByVal Value As Boolean)
_clickFill = Value
End Set


Try the above code for VB.NET. If you get any compilation errors make
sure that you are inheriting the proper namespaces. I think
System.ComponentModel is necessary. Look up the class Attributes that I
use and add the word Attribute in the MSDN. e.g. DescriptionAttrribute,
etc


End Property
recoil NO[at]SPAM community.nospam
3/8/2005 7:39:00 AM
Because, i guess VB.NET requires that the Property line that i put on a
separate line be on the same line, or you use the _ character at the
end of the first line to denote that it spans multiple lines.
thus

<Bindable(True), Category("Appearance"), DefaultValue(""),
Description("This is a brief description")> _
Property [Text]() As String
Get
Return _text
End Get

Set(ByVal Value As String)
_text = Value
End Set
End Property

or

<Bindable(True), Category("Appearance"), DefaultValue(""),
Description("This is a brief description")> Property [Text]() As String
Get
Return _text
End Get

Set(ByVal Value As String)
_text = Value
End Set
End Property

My apologies, I wrote the code in my head.
simon
3/8/2005 1:06:49 PM
Hi,

I tried like you suggest, but I get an error message:

Atribute specifier is not a complete statement. Use a line continuation to
apply the attribute to the folowing statement.
What is wrong?


lp,Simon


[quoted text, click to view]

AddThis Social Bookmark Button