C# winfrom listview 多窗口调用 - 杀死比特
2016-12-19 13:46:0 Author: www.cnblogs.com(查看原文) 阅读量:1 收藏

Form1

        private void button1_Click(object sender, EventArgs e)
        {
            Form f = new Form2(ref listView1);
            f.Activate();
            f.Show();
        }


Form2

        private ListView lv;
        public Form2(ref ListView _lv)
        {
            this.lv = _lv;
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            ListViewItem lvi = new ListViewItem();

            lvi.SubItems.Add("1");
            lvi.SubItems.Add("2");
            lvi.SubItems.Add("3");

            lv.Items.Add(lvi);
        }

posted @ 2016-12-19 13:46  杀死比特  阅读(766)  评论(1编辑  收藏  举报


文章来源: https://www.cnblogs.com/killbit/p/6197181.html
如有侵权请联系:admin#unsafe.sh