Need help to make window as overlay in WinUI3 application development.

MM, Sunil 81 Reputation points
2021-11-03T15:59:34.18+00:00

146273-11.png

Hi Team,

I have created WinUI3 project to make a overlay application show it on top of every other application.
I need below things to be implemented.

  1. How to change the background color of the window.
  2. How to remove the close icon in the top right corner of the winow.
  3. how to remove the image and title bar from the window.
  4. how to make the window transparent.

the code which i wrote is attached here.

help me to create a overlay kind of application here.

Windows App SDK
Windows App SDK
A set of Microsoft open-source libraries, frameworks, components, and tools to be used in apps to access Windows platform functionality on many versions of Windows. Previously known as Project Reunion.
438 questions
No comments
{count} votes

Accepted answer
  1. Castorix31 65,791 Reputation points
    2021-11-03T18:30:56.743+00:00

    You can call

    _presenter.SetBorderAndTitleBar(false, false);  
    

    You can change the transparency with SetLayeredWindowAttributes

    You can change the background with a Grid, a Border and Border.Background
    For example, I have set a Gradient as background in the XAML :

     <Border.Background>  
                        <LinearGradientBrush StartPoint='0,0' EndPoint='1,1'>  
                            <GradientStop Color='Yellow' Offset='0.0' />  
                            <GradientStop Color='Red' Offset='0.25' />  
                            <GradientStop Color='Blue' Offset='0.75' />  
                            <GradientStop Color='LimeGreen' Offset='1.0' />  
                        </LinearGradientBrush>  
     </Border.Background>  
    

    I get :

    146278-winui3-transparent.jpg


0 additional answers

Sort by: Most helpful