Monday, April 13, 2009

TextBox and other Controls with Transparent Background in XAML

Again a small item but something you may have searched for quite a while. In a XAML based user interface (WPF, Silverlight) if you want your control (e.g. TextBox) to NOT have a background, that is you want the background to be transparent you can do one of the following:
  1. Set its Background property to 'Transparent'
  2. In Expression Blend select the Background brush and set the alpha channel to zero
Sounds simple but it might take you longer than expected to find this information on the internet (unless I'm completely hopeless to enter the appropriate keywords). Most sources explain for the 100th time how to set the background color.

2 comments:

  1. Anonymous10:13 AM

    Good One !!! As you rightly said, this loks so trivial and I had to "Bing" a lot to get here.
    Thanks pal ...

    Raja Mohammed

    ReplyDelete
  2. Anonymous10:15 PM

    Who on earth uses bing ?

    ReplyDelete

All comments, questions and other feedback is much appreciated. Thank you!