Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WPF: How to make a button background transparent

I want to know how to set a wpf button background to transparent.

thank you

like image 812
Heart Avatar asked Dec 02 '10 09:12

Heart


People also ask

Which property you can use to make the control semi transparent?

To make an element transparent or semi-transparent, you set its Opacity property. A value of 0.0 makes the element completely transparent, while a value of 1.0 makes the element completely opaque.

What is Opacity WPF?

All WPF controls are inherited from UIElement. The Opacity property of UIElement is used to set transparency of a control. The value of Opacity falls between 0.0 and 1.0 where 0.0 is fully transparent and 1.0 is fully opaque.


2 Answers

<Button Background="Transparent"/>
like image 151
Guy Avatar answered Sep 22 '22 12:09

Guy


Transparency Declaratively

<Button Background="Transparent"/>

Transparency programatically

this.btnTransparent.Background = Brushes.Transparent;

Semi-transparency declaratively

Opacity="0.5"

Semi-transparency programmatically

this.Opacity = 0.5;
like image 20
James Poulose Avatar answered Sep 26 '22 12:09

James Poulose