locked
How can i over an image on top of a control in a Grid ? RRS feed

  • Question

  • I want to reduce the opacity on the Grid and display images on top of each control so that both image and control can be visible ,how can i achieve that using code behind and not xaml ?

    19karabo91

    Friday, January 31, 2014 7:35 AM

Answers

  • Set the opacity property on the control:

    <controlname>.Opacity = .2;


    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Friday, January 31, 2014 1:27 PM
    Moderator
  • If you put items inside a grid, they will automatically overlay each other.  That's why you need to use a stackpanel in most cases.


    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Friday, January 31, 2014 2:20 PM
    Moderator

All replies

  • Set the opacity property on the control:

    <controlname>.Opacity = .2;


    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Friday, January 31, 2014 1:27 PM
    Moderator
  • Yes but how do i display the image on top of a control ?

    19karabo91

    Friday, January 31, 2014 1:37 PM
  • If you put items inside a grid, they will automatically overlay each other.  That's why you need to use a stackpanel in most cases.


    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Friday, January 31, 2014 2:20 PM
    Moderator