I want to make the backgroundImage of my tabPages spread out to the available size.
According to other topics here on StackOverflow, I set the BackgroundImageLayout
in my Forms properties to Stretch
, but my background image is still being displayed as a tile.
Is there another flag I have to set? I feel like the seemingly global property does not quite affect tabPages.
PS: If it is of any significant matter, the picture is being added at runtime.
EDIT: This is how my Picture is being added to the tabpage as background:
TabPage tab = new TabPage();
tab.BackgroundImage = Image.FromFile(*path*);
tabControl.TabPages.Add(tab);
while tabControl is passed as a parameter inside the class, coming straight from my Form via this.tabControl
The fetching of the image works.
Also, the stretch attribute is currently set inside the forms properties.