Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there away to put a colored background in a wpf popup?

Is there a way to put a background color in a WPF popup in XAML.

like image 892
JLott Avatar asked May 25 '12 19:05

JLott


1 Answers

A WPF Popup has no default visual appearance. It is merely a place holder for content that needs to popup.

Simply have your Popup contain an item that does have a Background property and set that to your desired color as in this example from the Popup class documentation.

<Popup Name="myPopup">
    <TextBlock Name="myPopupText" 
               Background="LightBlue" 
               Foreground="Blue">
        Popup Text
  </TextBlock>
</Popup>
like image 50
Benjamin Gale Avatar answered Oct 05 '22 08:10

Benjamin Gale