Button button = new Button();
button.Text=xmlNode.Attributes["text"].Value;
button.Tag = tag;
button.Location = new System.Drawing.Point(x, y);
button.FlatStyle = FlatStyle.Flat;//样式
button.ForeColor = Color.Transparent;//前景
button.BackColor = Color.Transparent;//去背景
button.FlatAppearance.BorderSize = 0;//去边线
button.Image = Image.FromFile(@"D:\Pictures\" +xmlNode.Name+ ".jpg");
button.Size = new Size(200,350);
button.Click += new EventHandler(menuitem_Click);
x += 300;
this.Controls.Add(button);
button.Text=xmlNode.Attributes["text"].Value;
button.Tag = tag;
button.Location = new System.Drawing.Point(x, y);
button.FlatStyle = FlatStyle.Flat;//样式
button.ForeColor = Color.Transparent;//前景
button.BackColor = Color.Transparent;//去背景
button.FlatAppearance.BorderSize = 0;//去边线
button.Image = Image.FromFile(@"D:\Pictures\" +xmlNode.Name+ ".jpg");
button.Size = new Size(200,350);
button.Click += new EventHandler(menuitem_Click);
x += 300;
this.Controls.Add(button);