question

MMSunil-2457 avatar image
0 Votes"
MMSunil-2457 asked Castorix31 commented

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

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-winui3
11.png (49.5 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

Castorix31 avatar image
1 Vote"
Castorix31 answered cleric145-6909 commented

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



· 12
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks so much for your reply,
I need below helps here.
1.i want my window to be maximized always on screen.
2.i don't want any background on the window(only button should be visible) - all the background and border should looks transparent with no color.
3.Final design should looks like a overlay.

Best Regards,
Sunil146455-codebehind.png146409-xamlfile.png


0 Votes 0 ·
codebehind.png (47.3 KiB)
xamlfile.png (34.8 KiB)

I want my window to be maximized always on screen.

Perhaps you can SetPresenter CompactOverlayPresenter.

0 Votes 0 ·

HI
I am not able to drag and move the overlay/app which is present on my desktop.
Could you please tell me how to achieve this.
146450-overlay22.png


0 Votes 0 ·
overlay22.png (31.0 KiB)
Show more comments