ShouldSerialize and Reset methods should be used in this case, instead of
the DefaultValue() attribute.
i.e.
\\\
Public Property MyBackColor() As Color
..
End Property
Private Function ShouldSerializeMyBackColor() As Boolean
Return Not MyBackColor.Equals(Parent.BackColor)
End Function
Private Sub ResetMyBackColor()
MyBackColor = Parent.BackColor
End Sub
///
--
Mick Doherty
http://dotnetrix.co.uk/nothing.html
"Roger" <Ro***@discussions.microsoft.com> wrote in message
news:55**********************************@microsof t.com...
Hi, i want to make an ambient property for my control.
i have the ambient part working just fine , but in order to make this work
correctly in designtime i need to be able to set the "DefaultValue" of the
property dynamicly (not via [defaultvalue] attrib)
i mean , when placing a control on a form , the control get the same color
as the parent control , and the color is "defaulted"/"unchanged" it shows
up
in the propbrowser as unchanged (not bold) and it does not persist to the
initialize code
what should i do to accomplis the same?
should i make a typeconverter? typeeditor? controldesigner?
what?
//Roger
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (
http://www.grisoft.com).
Version: 6.0.742 / Virus Database: 495 - Release Date: 19/08/2004