Changing the sizemode of a background image in picturebox

Antonio Teh Sumtin picture Antonio Teh Sumtin · Apr 18, 2012 · Viewed 28k times · Source

My aim was to change the background image and set it's SizeMode as Stretch. Tried a lot so far, any ideas?

EDIT: I am working in C# forms application. Tried simply setting size mode of bg picture:

picturebox1.BackgroundImage = Properties.Resources.Image;
picturebox1.SizeMode = PictureBoxSizeMode.StretchImage;

tried to move around it... no success...

Answer

Skalli picture Skalli · Apr 18, 2012

Look at BackgroundImageLayout.
Example:

whatever.BackgroundImageLayout = ImageLayout.Stretch