User Control Doesn't Inherits the Property Added after using it...

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hai,

I've Created a User control for example a Button and i've given the font
of the text as Bold and compiled it. Now i've used this Usercontrol
everywhere in my project. Now i changed the font from Bold Italic to Regular,
and also changed the color. now in my project the changes are not inhertied
in already placed user control Buttons. but if i place a new button then i
can see the latest changes...

what can i do to inherit the latest property into my user control buttons
already exist in my project...
 
Hai Åukasz...

Please let me have an idea of "DefaultValue attribute" in VB.Net syntax...

ThnX in advance
--
Peter...


Åukasz said:
Prabhudhas said:
No I am not using [DefaultValue(...)] attribute... what is that...plz let
know about that also....

DefaultValue attribute specifies the default value for a property.
Example: (you have int ABC property and dafault value for this is 7)

[Browsable(true),DefaultValue(7)]
int ABC
{
get { return _abc; }
set { _abc = value; }
}

Åukasz
 
Prabhudhas said:
Hai £ukasz...

Please let me have an idea of "DefaultValue attribute" in VB.Net syntax...

ThnX in advance

Oops.. I'm sorry I forgot it's VB group (not C#) ;-)

So, this is that former example (in VB):

Private _abc As Integer = 7

<Browsable(True), DefaultValue(7)> _
Public Property ABC() As Integer

Get
Return _abc
End Get

Set
_abc = Value
End Set

End Property


£ukasz
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top