Click here to Skip to main content
15,889,266 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
VB.Net v4.6 - VS2015

Take the following code:

I have a class (KeywordClass) with some properties, a module with a declaration of

Friend _ImportKeywords As New List(Of String)
and a Write only property on the class of:

Public WriteOnly Property ImportKeywords() As List(Of String)
 Set(ByVal value As List(Of String))
        _ImportKeywords = value
    End Set
End Property

I am trying to pass a list to the property from outside of the class.

Dim Kwords As New List(Of String)
 Kwords.add("testing")
 Kwords.add("hello")
 Kwords.add("goodbye")


Using MyClass As New KeywordClass
  MyClass.ImportKeywords(Kwords)
  End Using


but Im getting the error: Too many arguments to 'Public WriteOnly Property ImportKeywords As List(Of String)'

If someone can help me, I'd be very appreciative. Thanks for your time :)

What I have tried:

I've done a fair bit of searching and all the results that have been solutions seem to point to just passing the list - which is what I have done above. Nothing else seems to work and Im probably missing the obvious. :/
Posted
Updated 8-Jun-18 6:05am

1 solution

doh. should have been = kwords. How stupid can I get. My excuse - its been a long long week and Im just glad its just over. Thanks for looking - maybe a lesson to learn in "the obvious". Cheers all.
 
Share this answer
 
Comments
Maciej Los 8-Jun-18 16:28pm    
You have to change the name of property to able identify it as a property, not as a method.
;)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900