C# How to make a custom window UI

Brandon Boone 31 Reputation points
2022-05-25T16:11:04.587+00:00

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?

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,663 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,175 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Castorix31 81,356 Reputation points
    2022-05-25T17:04:53.667+00:00

    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

    0 comments No comments

  2. Brandon Boone 31 Reputation points
    2022-05-25T18:53:23.3+00:00

    @ 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 ?

    0 comments No comments