question

BrandonBoone-0673 avatar image
0 Votes"
BrandonBoone-0673 asked HuiLiu-MSFT commented

C# How to make a custom window UI

I am using WPF and I have my window background set to transparency. I still wanted to do a Windows drop shadow, but I want to use the standard Windows drop shadow.

Does anyone know what the settings should be ?
I tried to look inside of the SingleBorderWindow style but I could not find it.
Does anyone know where is it at ?

I didn't see anything about the drop show settings.

Also, every time I make a Custom window, when I maximize the window it goes in to the neighboring monitors. So I started adding

<Margin="5,5,5,5" > at my outer most grid or Canvas.
is that right ?

Here is my code for maximize:

  public void SetFullScreen()
         {
             _currentWindow.WindowState = WindowState.Maximized;
             WindowRestoreTwoBoxVisibility = Visibility.Visible;
             WindowRestoreOneBoxVisibility = Visibility.Collapsed;
         }

Does anyone know the correct way for making a custom window?


dotnet-csharpwindows-wpf
· 1
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.

Hi,@BrandonBoone-0673. Could you show me your complete code to analyze? Is it possible to show what you expected and what is actually happening with a screenshot?

0 Votes 0 ·
Castorix31 avatar image
0 Votes"
Castorix31 answered

I still wanted to do a Windows drop shadow, but I want to use the standard Windows drop shadow.
Does anyone know what the settings should be ?

I had posted a basic sample for a custom window with a Drop shadow in this thread : WPF Rounded Window Drop Shadow Problem


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.

BrandonBoone-0673 avatar image
0 Votes"
BrandonBoone-0673 answered

@ Castorix 31

Thanks, that help but I still cannot seem to get my drop shadow to look like Window's.
This is my code:
<Border.Effect>
<DropShadowEffect BlurRadius="5" Opacity="1" ShadowDepth="3" Direction="270"
Color="Black"/>
</Border.Effect>

Does anyone know what the settings are for windows ?

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.