[Solved] How do I transfer a list from between two Forms? [closed]


The type you’re passing is:

List<macivari>

The type the constructor expects is:

List<string>

These are not the same type.

If Form2 needs a List<macivari>, then it should expect one:

public List<macivari> Freezers=new List<macivari>();
public Form2(List<macivari> a)
{

    InitializeComponent();
    Freezers = a;
    foreach (var item2 in Freezers)
    {

    }
}

If, on the other hand, it really does need a List<string> then you should supply it with one. How should a macivari be represented as a string? By its Names property, for example? Something like this?:

Form2 showme = new Form2(Freezers.Select(f => f.Names).ToList());

8

solved How do I transfer a list from between two Forms? [closed]