Transparency key on Form distorts text box content - c#

I have a Form on which TransparencyKey = Color.Black is applied.
Form contains a TextBox and it's text ForeColor is Red.
When Form transparency is active, i.e. when TransparencyKey = Color.Black text looks somehow distorted it looks like some black background elements were not removed with TransparencyKey, when form is placed on any bright (white) background.
When form is presented on dark background, everything looks ok.
I have posted a screen of my form to show you this behaviour (inserting image does not work for me right now I dunno why):
How to fix this so that text will be smooth as it should be independent on the background colour?

Related

I have a picture box with an image without background but it only takes the color of the form as background

I'm doing the table game battleship, by moving pictures boxes with the mouse, the problem is that all the picture boxes that I have contain an image without background, but i have the problem that when I move it through different points, it shows a default background instead of showing the background of the "map". This messes the aspect of the game table.
I've tried this code in my program ,but it makes the ships default position is in the panel(which I do not want) and it doesn't solve the problem I described earlier (when you move ships over the others spaces)
Barco1.Parent = panel1;
Barco1.BackColor = Color.Transparent;
An example of one of the ships
As you can see in the picture, there are:
Form with a BackgroundImage,
Panel with BackColor = Color.Transparent and BackgroundImage = some-image and
PictureBox with BackColor = Color.Transparent and an image as its Image property.
It should work for you.
It looks like You are setting the Image background as Transparent but You are adding that Image into another Panel!
Barco1.Parent = panel1;
So, Set the Background Color of the Panel1 as Transparent:
panel1.BackgroundColor=Color.Transparent;

How to split a form background color in c# so one half is black and the other is white

I am stuck on figuring out how to split the background colors so the left side of the form is black and the right side of the form is white in response to the ClientSize of width and height and when the form is clicked, the background color inverses
Use two panels both equal to 50% of the form. You can then manipulate their background color.

DefaultPropertyAttribute in Propertygrid control showing the background color as gray after load

Background color for a DefaultPropertyattribute shown as gray after loading form as shown in below image.
how to remove that color while loading the form.
Thanks in advance....

How to change backcolor, with back object color?

When I move a picturebox in a form when application is started, I want picturebox backcolor with transparency using back object color, But no transparent with form backcolor
If you are looking to set the back color as same as the form which is solid color. U can user the Backcolor property of the picture box and set it to form's back color.
Also have a look at this post.
C# Picturebox transparent background doesn't seem to work

Transparent controls in .NET

I have a problem with:
BackColor = Color.Transparent;
It's not working correctly. I have a form with a blue background, and a picturebox with a picture loaded in it. It's not actually taking what's in the picture, but rather - the form's background color. Please tell me there's a simple way to go around this?
What you see in the following screenshot is a custom usercontrol with it's backColor set to transparent, on top of a picture, in a form with a blue background.
I need the usercontrol to display what's UNDER it, as real transparency, it should be showing the gradient and part of the image.
Try setting the picture box to be the parent of the custom user control.
myControl.Parent = this.myPictureBox;
Try calling "SetStyle(ControlStyles.SupportsTransparentBackColor, true);" on your user control constructor.
more details at: http://msdn.microsoft.com/en-us/library/wk5b13s4(v=vs.90).aspx

Categories

Resources