My Class in CustomWebRectangle -Type "Iterable" has no member named "AddControlToItem"

I created a class “ObjectsOnRectangle”. I added an Integer array and the “AddNumber(number As Integer)” method.
Everything works fine on WebPage (Button1.Pressed), but I can’t do it in CustomWebRectangle.Opening

Sub Opening() Handles Opening
  Me.Objects = New ObjectsOnRectangle
  For Each c As WebControl In Me.Controls
    Me.Objects.AddNumber(1) 'Type "Iterable" has no member named "AddNumber" Me.Objects.AddNumber(1)
End Sub

How to do it?

I’ve attached a simple example. Please help

The name Objects is a function of the framework that you won’t be able to override. Name the property just about anything else and your code will work.


Hi Artur,

You just have to rename the property CustomWebRectangle.Objects because Objects is an existing property of WebRectangle, see the doc.
Rename Objects property to e.g. Objs and update your code accordingly.


EDIT: @Tim_Parnell types faster than me :wink:


I was aware of such a mistake, so not “Add” but “AddNumber”, but I was not careful enough
Thank you @Tim_Parnell and @Olivier_Colard for your quick help :slight_smile: