Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Apr 22, 2012 06:08 AM by jkirkerx
Aug 19, 2010 09:31 AM|LINK
I have a User Control (ascx) and a property which a want to display in my categories tab in Visual Studio in the category named "Styles".
And here is the problem: Actually I do not need a get, because I only have to set the property (write only property). But when I omit the get, the property is displayed in the "Misc" category in the categories tab in Visual Studio. Only when I code the get
as well, then the property is displayed correctly in the "Styles" category in the categories tab in Visual Studio.
Does anybody know why? How can I display the category correctly only with set?
Aug 24, 2010 02:23 AM|LINK
Please refer this article about creating user control with read-only and write-only property:
Aug 25, 2010 03:52 AM|LINK
To use the property
.CssClass = [CssStyle_Text]
<Category("First Payment Entry Properties")> _
<Localizable(True)> Property CssStyle_Text() As String
Dim _CssStyle_Text As String = CStr(ViewState("CssStyle_Text"))
If _CssStyle_Text Is Nothing Then
Set(ByVal Value As String)
ViewState("CssStyle_Text") = Value
Jan 20, 2012 10:37 AM|LINK
Sorry, both replies didn't anser my question.
The question was, why the behaviour of a User Control's property displaying in a certain category in the Visual Studio property tab is different depending on the usage of get and set accessors. It may be simply a bug of Visual Studio?
Apr 22, 2012 06:08 AM|LINK
You have to tell the property, what the category is, or else it will default it to misc.
It can't read your mind, and you didn't show any code for anyone to reference.
I posted code that showed you the answer. I should of made the line in bold. text.
You have to get and set, if you don't get, then the properties explorer won't be able to display all the properties when in design view.