Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7926213
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T18:40:20+00:00 2026-06-03T18:40:20+00:00

ok, maybe it’s not a method exactly. here’s what I’d like to do: Private

  • 0

ok, maybe it’s not a method exactly. here’s what I’d like to do:

Private _Columns As ArrayList
Public Property Columns() As ArrayList
    Get
       Return _Columns
    End Get
    Set(Cols As ArrayList)
       _Columns = Cols
    End Set
    Set(Cols As MyOwnList)
       _Columns = New ArrayList
       For Each o As MyObj in Cols
          _Columns.Add(o.Column)
       Next
    End Set
End Property

which would allow me to conveniently set the property by assigning to it various kinds of collection types… except, I can’t do it because apparently the Set method has to take an argument of the type of the property itself… I get the complaint:

‘Set’ parameter must have the same type as the containing property

is there a way to do this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T18:40:21+00:00Added an answer on June 3, 2026 at 6:40 pm

    It’s not really overloading but the following could offer a (temporary) workaround:

    Private Cols As ArrayList
    Public Property Columns() As ArrayList
        Get
            Return _Columns
        End Get
        Set(Cols As ArrayList)
            _Columns = Cols
        End Set
    End Property
    
    Public WriteOnly Property SpecializedColumns() As MyOwnList
        Set(value As MyOwnList)
            Dim list As New ArrayList
            For Each o As MyObj In value
                list.Add(o.Column)
            Next
            Columns = list
        End Set
    End Property
    

    I think this is as close as you can get to real overloaded properties…

    EDIT

    I believe the proper way to do what you’re trying to achieve is to define a ToArrayList() method on your MyOwnList class.

    Public Function ToArrayList()
        Dim list As New ArrayList
    
        For Each o As MyObj In Me.Items
            list.Add(o.Column)
        Next
    
        Return list
    End Function
    

    and set your property like this:

        Columns = theMyOwnListObject.ToArrayList
    

    If you don’t have access to the source code of the class, you can still achieve this through extension methods.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Maybe I misunderstood the layout_weight parameter but I can't get it why something like
maybe it's dumb but is there a difference between new Something().method(); and Something tmpSomething
Maybe I'm missing it somewhere in the PHP manual, but what exactly is the
Maybe I'm not searching correctly, but I can't find out how to configure the
Maybe someone could explain the difference between property: in .h file @property(nonatomic,retain) NSString *someString;
maybe you could help me understand why I get an unhandled exception Invalid XAML
Maybe I misunderstood the functions of .on() api of jQuery . Here is the
maybe someone could recommend some good examples concerning thread executions, thread management. Maybe not
Maybe it's useful if calling a method that MyClass doesn't understand on a something
Maybe a silly question but here goes anyway. Example: Let's say I have one

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.