August 10, 2004
The property does not maintain an instance of ArrayList itself.
You also have the concept of the property wrong. What you should
do is create a page level variable of ArrayList and then create a
sub that you call to add a filter. Then if you want to retrieve the
filters,
just access the arraylist variable directly. This looks something like:
dim filters as new ArrayList
Private Sub AddFilter()
filters.add(cbofilter.text)
End Sub
Private Sub Button1_Click(....)
if filters(0) = "Something" then
.... ' do something with list
End Sub
A property is maintained by something like this:
dim _userinput as string
Public Property UserInput() as String
Get
return _userinput
End Get
Set (byval value as string)
_userinput = value
End Set
End Property
Then you can use the property like this: Class.Userinput = Something.
I hope this makes sense! Have a good day!
Joseph MCP
"Just Me" wrote:
This doesn't work. I guess New is needed someplace but I don't know where?
Public Property Filters() As ArrayList
Get
Filters.Add(cboFilter.Text)
---snip--
Thanks in advance for any info