Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 731453
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T07:01:41+00:00 2026-05-14T07:01:41+00:00

When you set the opacity on a Grid in WPF, all the child elements

  • 0

When you set the opacity on a Grid in WPF, all the child elements appear to inherit its Opacity. How can you have a child element not inherit the parent’s opacity?

For example, the following parent grid has one child grid in the middle with a background set to red, but the background appears pinkish because of the parent’s opacity. I’d like the child grid to have a solid color, non-transparent background:

<Grid x:Name="LayoutRoot">

  <Grid Background="Black" Opacity="0.5">
    <Grid.RowDefinitions>
      <RowDefinition Height="0.333*"/>
      <RowDefinition Height="0.333*"/>
      <RowDefinition Height="0.333*"/>
    </Grid.RowDefinitions>
    <Grid.ColumnDefinitions>
      <ColumnDefinition Width="0.333*"/>
      <ColumnDefinition Width="0.333*"/>
      <ColumnDefinition Width="0.333*"/>
    </Grid.ColumnDefinitions>

    <-- how do you make this child grid's background solid red
        and not inherit the Opacity/Transparency of the parent grid? -->
    <Grid Grid.Column="1" Grid.Row="1" Background="Red"/>
  </Grid>

</Grid>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T07:01:42+00:00Added an answer on May 14, 2026 at 7:01 am

    I was able to achieve something like this in pure xaml using a Brush to paint the main grids background.
    This way only parent grid will have its opacity set and its child elements won’t inherit it.

    <Grid x:Name="LayoutRoot">       
          <Grid>
            <Grid.Background>
                <SolidColorBrush Color="Black" Opacity="0.5"/>
            </Grid.Background>
            <Grid.RowDefinitions>
              <RowDefinition Height="0.333*"/>
              <RowDefinition Height="0.333*"/>
              <RowDefinition Height="0.333*"/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
              <ColumnDefinition Width="0.333*"/>
              <ColumnDefinition Width="0.333*"/>
              <ColumnDefinition Width="0.333*"/>
            </Grid.ColumnDefinitions>
    
            <Grid Grid.Column="1" Grid.Row="1" Background="Red" />
          </Grid>   
    </Grid>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple on my page with the opacity being set to 0.5.
I have a image (png file) with opacity 35%, i want for example: Set
I have an issue with IE8, while set opacity of a pie chart. I
I have to develop a semi-transparent form in WPF, but controls should not be
I have a WPF page. Page has some content, but the last child component
I have a div that has it's opacity set to 60. Inside the div,
I need to set an HTML <img src=/> object's opacity in JavaScript in all
I'm trying to set opacity of element by jQuery. $('[class*=OtherFeatur]').load(function(){ $(this).fadeTo(500, 0.5); }); is
The WPF Grid has an IsMouseOver property that you can use in the Grid's
I have some code (android source), and Im trying to set Opacity of a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.