C# 更改picturebox中背景图像的sizemode

C# 更改picturebox中背景图像的sizemode,c#,winforms,background-image,picturebox,image-resizing,C#,Winforms,Background Image,Picturebox,Image Resizing,我的目标是更改背景图像,并将其SizeMode设置为Stretch。 到目前为止做了很多尝试,有什么想法吗 编辑:我在C#forms应用程序中工作。尝试简单设置bg图片的大小模式: picturebox1.BackgroundImage = Properties.Resources.Image; picturebox1.SizeMode = PictureBoxSizeMode.StretchImage; 试图绕过它。。。没有成功…看看。 例如: whatever.BackgroundImag

我的目标是更改背景图像,并将其SizeMode设置为Stretch。 到目前为止做了很多尝试,有什么想法吗

编辑:我在C#forms应用程序中工作。尝试简单设置bg图片的大小模式:

picturebox1.BackgroundImage = Properties.Resources.Image;
picturebox1.SizeMode = PictureBoxSizeMode.StretchImage;
试图绕过它。。。没有成功…

看看。
例如:

whatever.BackgroundImageLayout = ImageLayout.Stretch

Windows窗体?WPF?网络表单?Silverlight?如果你想让标题说明一切,你不应该在它前面加上“C#Forms”。这就是标记的用途。PictureBoxizeMode、BackgroundImageLayout是用于相同目的的不同枚举。净一致性…不客气。下次尝试更具体一点,展示你从一开始就尝试过的东西。这使我们更容易帮助你。这就是你想要的使用this=which//this.BackgroundImageLayout=ImageLayout.Stretch;