ProvidePropertyAttribute

  • Thread starter Thread starter JC Voon
  • Start date Start date
J

JC Voon

Hi:

How to set the default value of the ProvideProperty ?
My ExtenderProvider only accept control, and it has a internal
hashtable which is use to holds the property values for individual
controls, currently the hashtable hold all the control on the form
regardless whether i set the provided property or not, how do i
enabled it so that only the control which i set the provided property
will save to the hasktable ? My guess is the default value like the
ordinary property do, any idea ?

Thanks
JCVoon
 
JC Voon,

Can you show some code, because I assume that most probably I understand you
wrong.

Cor
 
Cor Ligthert:

Can you show some code, because I assume that most probably I understand you
wrong.

Thanks for the reply, i already figure it out.

Private Class MyProvidedProperties
Public MyProperty As string = string.Empty <----- A
....
end class

...
..
Function GetMyProperty(ByVal ctrl As Control) As String
If htProvidedProperties.Contains(ctrl) Then
Return DirectCast(htProvidedProperties(ctrl),
MyProvidedProperties).MyProperty
Else
Return String.Empty <----- B
End If
End Function

Make sure A and B is same value.

Thanks
JCVoon
 

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