How can I expose a WriteOnly Property to the designer when making a Component?

  • Thread starter Thread starter James Coe
  • Start date Start date
J

James Coe

How can I expose a WriteOnly Property to the designer when making a
Component?

I have a property:

Public WriteOnly Property Password() As String
Set(ByVal Value As String)
If Not blnPasswordSet Then
DataHandler.Password = Value
blnPasswordSet = True

End If

End Set
End Property

I want to expose it in the property window of the designer but don't want to
make it read/write. Any ideas?

Thanks,
James Coe.
 
[Disclaimer: I haven't tried this to see if teh designer manages to persist the ******** value]

Why not make it read/write but int the getter return "***********" instead of the real value.

But more fundementally, why do you want to make it writeonly - surely the person who enters the password should be able to see the value that they entered? and anyway unless you do something more in teh setter of the property, the password is going to be in clear text in the code anyway

Regards

Richard Blewett - DevelopMentor
http://staff.develop.com/richardb/weblog

nntp://news.microsoft.com/microsoft.public.dotnet.framework/<[email protected]>

How can I expose a WriteOnly Property to the designer when making a
Component?

I have a property:

Public WriteOnly Property Password() As String
Set(ByVal Value As String)
If Not blnPasswordSet Then
DataHandler.Password = Value
blnPasswordSet = True

End If

End Set
End Property

I want to expose it in the property window of the designer but don't want to
make it read/write. Any ideas?

Thanks,
James Coe.



---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.770 / Virus Database: 517 - Release Date: 27/09/2004



[microsoft.public.dotnet.framework]
 
Back
Top