C#如何同时将已知路径的多张图片分别添加到多个动态生成的按钮上?
1个回答
2016-09-01
展开全部
private System.Windows.Forms.Button button1;
//按你自己的要求动态实例化按钮控件
this.button1.Location = new System.Drawing.Point(807, 440);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 23);
this.button1.TabIndex = 8;
this.button1.Text = "button1";
//添加指定路径图片值按钮控件
string strPath="X:\xx\xx.xxx"; //图片路径
this.button1.Image = new Bitmap(strPath);
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询