用户控件

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace 用户控件
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            for (int i = 1; i <= 15; i++)
            {
                First f = new First();
                f.pictureBox1.BackgroundImage = Image.FromFile("G:\\0425\\6、WinForm\\2016-7-4\\用户控件\\用户控件\\images\\1.png");
                f.pictureBox1.BackgroundImageLayout = ImageLayout.Stretch;
                f.label1.Text = "用户" + i;
                f.label2.Text = "签名" + i;

                flowLayoutPanel1.Controls.Add(f);
            }

        }
    }
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace 用户控件
{
    public partial class Form2 : Form
    {
        public Form2(string a,string b)
        {
            InitializeComponent();
            label1.Text = a + "," + b;
        }
     }
}

 

posted on 2016-07-18 16:05  爱意红沉  阅读(115)  评论(0编辑  收藏  举报