您的位置:首页 > 其它

.net winform 从资源文件中引用图片资源

2010-07-05 09:31 316 查看
Button cbtn = new Button();
cbtn.BackgroundImage = global::MIS.Properties.Resources.button2;    //从资源文件中引用
btn.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;

cbtn.Dock = DockStyle.Top;
cbtn.Text = ctext;
cbtn.Name = cname;
cbtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
cbtn.FlatAppearance.BorderSize = 0;
cbtn.Margin = new System.Windows.Forms.Padding(0, 0, 0, 0);
cbtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(233)))), ((int)(((byte)(233)))), ((int)(((byte)(233)))));
//btn.Location = new System.Drawing.Point(0, 0);
cbtn.Font = new Font("", 10);
cbtn.Size = new System.Drawing.Size(183, 25);
cbtn.Cursor = Cursors.Hand;
cbtn.Visible = false;
cbtn.Click += new EventHandler(btn_ClickRightBind);
this.flowLayoutPanel1.Controls.Add(cbtn);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: