Thick border on the right and on the left

gReX

My RibbonWindow Desktop Application shows a thick black border on both sides in Windows 10. You can reproduce this by a simple WPF Application showing a RibbonWindow. The border is not showing on Windows 8.x.

Does anybody know, how to remove the border?

enter image description here

Some guy asked a similar question on msdn, and the answer 'it's a known issue'. But following the provided link I can't find any specific.

So can anybody help me out of this?

Edit: the color of the borders is black, if the window is not active. If the window is active, the border get the color from the customized windows accent color.

Vatsan

Consider using WindowChrome with GlassFrameThickness = GlassFrameCompleteThickness.

This is not an ideal solution - you'd have to carefully make room for the window title as well as the maximize, minimize and close buttons. That said, it does get rid of the border problem you are dealing with.

For an example of how to manage the layout of content when WindowChrome is in use, see this SO answer.

Here is a complete XAML that should also help:

<RibbonWindow x:Class="RibbonTest.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:RibbonTest"
              xmlns:shell="clr-namespace:System.Windows.Shell;assembly=PresentationFramework"
        mc:Ignorable="d"
        Title="RibbonWindow" Height="350" Width="525">
    <WindowChrome.WindowChrome>
        <WindowChrome GlassFrameThickness="{x:Static shell:WindowChrome.GlassFrameCompleteThickness}"/>
    </WindowChrome.WindowChrome>
    <Window.Template>
        <ControlTemplate>
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="30"/>
                    <RowDefinition Height="1*"/>
                </Grid.RowDefinitions>

                <!-- Opacity of < 1.0 helps show the minimize, maximize and close buttons -->
                <Border Grid.Row="0" Background="Wheat" Opacity="0.8">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="30" />
                            <ColumnDefinition Width="1*"/>
                        </Grid.ColumnDefinitions>


                        <!-- Window Title - Center Aligned -->
                        <TextBlock 
                            Grid.Column="1"
                            TextAlignment="Center" 
                            VerticalAlignment="Center"
                            Text="{Binding Title, RelativeSource={RelativeSource TemplatedParent}}" />

                    </Grid>
                </Border>

                <!-- This is the Window's main content area -->
                <!-- Top margin 44 = WindowChrome ResizeBorderThickness (4) + CaptionHeight(40) -->
                <!-- Bottom margin 1 is somewhat arbitrary -->
                <Border Grid.Row="1" Background="White" Opacity="0.5">
                    <ContentPresenter Content="{Binding Content, RelativeSource={RelativeSource TemplatedParent}}"/>
                </Border>
            </Grid>
        </ControlTemplate>
    </Window.Template>
    <Grid>
        <Border Background="Cyan" BorderBrush="BlanchedAlmond" BorderThickness="5">
            <Label FontSize="80" HorizontalAlignment="Center" VerticalAlignment="Center">Hello World</Label>
        </Border>
    </Grid>
</RibbonWindow>

The resulting RibbonWindow would look something like this:

enter image description here

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Animate border left to right

From Dev

border setting for the top right left

From Dev

Navbar border left & right issue

From Dev

Animating bottom border (left to right)

From Dev

Navbar border left & right issue

From Dev

Animating bottom border (left to right)

From Dev

Remove border on far left and far right

From Dev

Overlapping table element left and right border

From Dev

Sass border top, left, bottom, right

From Dev

Border drawable for a view in Android with margins on left or right

From Dev

Way of shortening border left right bottom?

From Dev

On hover animate bottom border left to right

From Dev

<tr> removing border on left and right only

From Dev

Sliding border from right to left using CSS

From Dev

Left and Right side container border not the same

From Dev

Sass border top, left, bottom, right

From Dev

Border-bottom from left to right

From Dev

CSS - left border of button is rounded on the right side

From Dev

Shift TD border-left to the right a bit

From Dev

Force border-top to overlap border-left/border-right

From Dev

How to give corner of table cell border the color of top/bottom border instead of the left/right border

From Dev

Setting border-bottom/top-right/left-radii

From Dev

How to align 2 buttons to left & right border of a UIToolbar

From Dev

How to set left and right border gradient precisely in WPF

From Dev

Div with border and top/right, bottom/left transparent edges

From Dev

How to give Double Border-right & left colors

From Dev

Display Table-Cell: Remove Right and Left Border Space?

From Dev

Dotted border from left to right (between two elements)

From Dev

Is it possible to move border-bottom left or right in a list?

Related Related

HotTag

Archive