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 8387185
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T18:08:37+00:00 2026-06-09T18:08:37+00:00

I have Class Supplier with 2 data member are SupID and SupplierName and 1

  • 0

I have Class Supplier with 2 data member are SupID and SupplierName and 1 Constructor then I add this objects into List of Supplier when Form1 load().

    Dim lst As New List(Of Supplier)

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
       AddList()
    End Sub

    Public Sub AddList()
       lst.Add(New Supplier("Sup1", "Supplier1"))
       lst.Add(New Supplier("Sup2", "Supplier2"))
       lst.Add(New Supplier("Sup3", "Supplier3"))
       lst.Add(New Supplier("Sup4", "Supplier4"))
       lst.Add(New Supplier("Sup5", "Supplier5"))
    End Sub

And then I want to send lst to Form2 by its new instant constructor when I click Send Button:

    Private Sub cmdSend_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSend.Click
       Dim frm As New Form2(lst)
       frm.Show(Me)
    End Sub

Next In form2, code like this:

    Dim lst As New List(Of Supplier)
    Dim bs As BindingSource

    Public Sub New(ByVal lst As New List(Of Supplier)
       Me.InitializeComponent()
       Me.lst = lst
       bs = new BindingSource(lst,nothing)
    End Sub

And then I want to remove the object from bs:

    Public Sub cmdRemove_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdRemove.Click
       bs.RemoveCurrent()
    End Sub

The problem is that, when i remove the object from bs in Form2, the object in lst in Form1 is affected too. So how can I do if I don’t want the list in Form1 affect?

Thank you in advance….

  • 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-09T18:08:38+00:00Added an answer on June 9, 2026 at 6:08 pm

    Try changing the code in Form2 to this:

    Dim lst As List(Of Supplier)
    Dim bs As BindingSource
    
    Public Sub New(ByVal lst As List(Of Supplier))
       Me.InitializeComponent()
       Me.lst = New List(Of Supplier)(lst)
       bs = new BindingSource(Me.lst, Nothing)
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have written this class-methods for .net 2.0 to create objects from '|'-separated strings
I have the following code: class Orders{ /** * * @var Supplier */ private
I have Class and Student objects. Both have collection of another as property. Which
I have class that extend FragmentActivity in it I add fragment to layout as
I have class like this below shown. which contains the shopping items where the
I Supplier class: public class Supplier { .... .... .... } I have also
You have a class, that perfectly fits to be an abstract, but this class
I have a framework which works this way: After defining some meta data, it
Good morning. I have a class with data derived from InotifyPropertyChange. The data come
I have this data in an array stored as $eventTitles . I am trying

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.