I have a listbox subclass that adds property arrays that need to be synchronized with the standard list and row tags. To do this I need to override some of the standard methods. For example, my AddRow(value) is:
super.AddRow(value) // update standard item list
AuxList.Append(dummy) // update subclass property
// do other stuff with AuxList
I need to override RowTag(), for which the syntax is: RowTag(i) = value. My version would be like:
super.RowTag(row) = ???
AuxRowTag(row) = dummy
// do something with AuxRowTag
Problem: How do I capture the value parameter (???). It doesn’t seem to be available in the method editor.
Workaround: Change the syntax to RowTag(i, value). This would force a rewrite of existing code.
When you add a method to a subclass, go to the method name field and on the right is a drop down menu button. Click that and it’ll list all the methods for overriding, and select one to fill out the whole signature.
For RowTag on Listbox fills out as
[code]Public Function RowTag(row As Integer) as Variant
Public Sub RowTag(row As Integer, Assigns _value As Variant)[/code]
Assigns is probably a keyword you’re not familiar with yet. That’s where the ??? comes through.
Thanks for the input. In my example, I was overriding the base class AddRow method (same name & signature, different behavior). I didn’t use the method name drop down, so I didn’t realize there was an overloaded subroutine (same name, different signature) for the RowTag function. It looks like “assigns” is what I was missing. Thanks again!