mardi 4 août 2015

Modifying a list from another form

I am trying to set up a list in C# and I want it so that when I press the an add button it will open a window with fields where I can enter data press and ok button and then have those text box fields transferred into the list. This is my code for the popup form.

public partial class addtoLibraryDialog : Form
{
    public addtoLibraryDialog()
    {
        InitializeComponent();
    }


    private void btnOK_Click(object sender, EventArgs e)
    {
        ListViewItem list = new ListViewItem("name");
        list.SubItems.Add("path");
        listView1.Items.Add(list);
    }
}

And I was wondering how I can make it so the listview1 is recognised. I have found information on this outline but as I am new to programming I can't really make heads of tails of them.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire