I have a form that I want to use with background, when I'm loading the background all my labels and richtexts still have as backcolor "Control", when I choose "Transparent" for the labels it's working, but when I choose it for the richtexts I', getting the error: "Control does not support transparent background colors."
How can I fix this?
NO you can't?
set TransparencyKey of window to control background color
setting this property will make this color transparent on whole window
use two windows overlapping each other one with background and another with your controls with transparency key
Related
I created a PNG with a transparent background. If I set my button control to have that image as a background, I see grey where I should be seeing the form it is set on. I set BackColor for the button to transparent, but to no avail.
How can I make it work right?
I use User Control in panel. When I use white as BackColor of something it becomes transparent automatically even all kind of operation can be done over my app.
What if you try to set BackColor to 'Grey'? does it work?
And could you add screenshoot from User Control properties?
In Win Form, we can create non-rectangular forms by creating a bitmap that have a background color like blue. So, we can set it to background image of Win Form and with change TransparencyKey option to blue, we have a shaped-window.
So, my question is What is the equivalency to TransparencyKey in WPF that does like Win Form's TransparencyKey?
Thanks for your attention :)
There is no equivalent.
Just use an image with transparent areas (so it has to be a PNG or GIF), set the WindowStyle to None, set the window's background to Transparent, and set AllowTransparency to true.
Transparent areas will not be clickable.
Set AllowTransparency to true then use pixel shader effect library for wpf.
Use this link for more details about how to use pixel shader : Green screen in wpf
I want to make the background of a PictureBox control transparent. In the PictureBox (rectangular shape), I placed an icon (circular in shape). I want to make the icon transparent so that the other portion underneath the icon is visible.
I have tried setting the PictureBox.BackColor property to "Transparent", but it doesn't work. I also tried to set it during runtime with the Color.FromArgb method, but it doesn't work either.
Is there any solution to this problem?
Setting pictureBox.BackColor = Color.Transparent; definitely should work.
Also verify if you are setting alpha channel of color when using Color.FromArgb(0, 0, 0, 0); (this is a first parameter, zero means transparent color)
And, of course, make sure your icons have transparent background.
If using WinForms then Setting the background color to transparent won't work as transparency handling is not a cascading system - you can only (in most cases) set transparency (or rather the opacity) of a control overall using the Opacity property, however this will alter the alpha channel of the entire control display giving your images a see-througness.
One solution might be to set the background color of the PictureBox to be that of the control beneath it (the color of the form, for example). But this may not suffice in your situation.
hi you must set the icon on the other portion underneath the icon by using this
icon_pictureBox_name.Controls.Add(other_portion_picturBox_name);
and after that you can set the PictureBox.BackColor property to "Transparent" and it will work ;)
how to make any control of win application transparent. i want that i will assign a background image for the target control and will invoke a routine and that routine will create that control transparent in such a way that only image will visible. as a example suppose image has assign to picture box. the picture shape is not square rather irregular. if i can make picture box transparent then user will see the image only. basically i want to make a picture box or any control irregular shape. how to achieve it through code in c#.
thanks
In WPF, transparency is quasi for free. For the image-element, assign a png-image with an alpha mask and the image will be rendered with active transparency.
For controls with an solid background, you generally have to set the Background to a transparent Brush:
If you want to make a whole window partial transparent, you have to remove the border, set the window style to none, set the background brush to a transparent brush, and set the AllowsTransparency-property of the window to true.
there is one for ordinary winform at
http://www.youtube.com/watch?v=K_JzL4kzCoE