c#中如何添加图片做为背景

来源:百度知道 编辑:UC知道 时间:2024/09/26 01:24:11

可以插入一个imagebox,将图片放到它里面,再设置其属性:

//
// pictureBox1
//
this.pictureBox1.Image = global::Day2.Properties.Resources._1;
this.pictureBox1.Location = new System.Drawing.Point(0, 0);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(293, 139);
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
this.pictureBox1.TabIndex = 7;
this.pictureBox1.TabStop = false;
//

web还是winform?
要是winform的,在每个控件的属性那添加就可以
那有个[...]按钮
看看吧
web的等高人

在设计器 里 右键点 标签 点样式 里面有设置背景图片的