I'm working on a Winforms (C#) benchmark project and am trying to build a Spongebob-themed GUI. When someone clicks on the "Start Benchmark" button, it will redirect the user to a page containing a GIF with Patrick smashing a computer, together with an "Exit" button and with a "Running benchmark..." label attached.
I'm using a texture for the "Exit" button, which doesn't really have a rectangular form. So, I'm using the BackColor = Transparent
property to avoid having "random white corners".
I'm also using the pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage;
in the Form.Load()
method, because I realized PictureBox
doesn't have any property that lets you stretch an image all over the control.
This is how the form looks like (in VS):
The GIF should stretch out on the whole form (and it does that without any problems). The only problem is this:
Exit and Running benchmark... controls have a background color, and I noticed this happens only when putting them on the PictureBox
. All three controls (Button
, Label
and PictureBox
) have the BackColor=Transparent
property set, but this one doesn't seem to do anything in my case.
My question is: how can I make the background of the button and the label transparent? (programmatically or not)