Click here to Skip to main content
15,991,030 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
dear my friends , i got this error (Control does not support transparent background colors)
i tried a lot of code at form but same issues , i was think my project have something wrong or missing , but i get empty form and project and i got same issues , so c# stop support BackColor transparent

Note: i make launcher/Patch for online game
i want to make my form as picture png

thanks so much

What I have tried:

i tried :
form.BackColor = Color.Fuchsia;
form.TransparencyKey = form.BackColor;
form.BackgroundImage = Image.FromFile("D:\\pie.png");
form.Paint += form_Paint;
//form.MouseDown += form_MouseDown;
form.Show();

-------------------------------------------------------------
this.SetStyle(ControlStyles.SupportsTransparentBackColor, true);

InitializeComponent();
--------------------------------------------------------------
this.BackColor = colorDialog1.Color;

if (colorDialog1.ShowDialog() == DialogResult.OK) {

this.BackColor = colorDialog1.Color;
Util.gs_ThemeColor = colorDialog1.Color.Name;

}



this.BackColor = Color.FromName(Util.gs_ThemeColor);
-------------------------------------------------------------
this.SetStyle(ControlStyles.SupportsTransparentBackColor, true);
this.BackColor = Color.Transparent;
Posted
Updated 15-Aug-19 23:16pm

See here - there are several solutions to get a transparent form: c# - Transparent background on winforms? - Stack Overflow[^]
 
Share this answer
 
Comments
Ahmed Adel 16-Aug-19 5:43am    
thanks so much bro its worked :)
OriginalGriff 16-Aug-19 5:52am    
You're welcome!
 
Share this answer
 
Comments
Ahmed Adel 16-Aug-19 5:43am    
that not worked bro , but thanks for trying help me
Richard MacCutchan 16-Aug-19 7:13am    
Since you have not explained what you tried it's not possible to say why it did not work. I have looked at the link you say did work and it makes the same suggestion.
Ahmed Adel 17-Aug-19 3:13am    
as i said i want my form as transparency ... and i already tried that only work on my form code :this.BackColor = Color.black;
this.TransparencyKey = Color.black;

that code work on load : main_load
but still have frame for my picture not pure
if you can help me more thanks

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900