Remove border from WPF window

Asked

Viewed 641 times

1

I have this window with an image defined as background, ok, but note that the image is not occupying the whole window. How can I remove these edges?

Remembering that, the window is with the following properties in XAML:

AllowsTransparency="True" 
WindowStyle="None" 
ResizeMode="NoResize" 
WindowStartupLocation="CenterScreen"

WPF window image background issues

1 answer

1

Hello, The feature you intend to manipulate can be called two ways.

In Controles

Some controls of WPF already own the property Border. Ex: Listbox, Button, Gridview.

Controls with this property can have the thickness manipulated through the attribute BorderThickness, the color of edge through the BorderBrush and the "curvature" through the BorderRadius.

Border (WPF Control)

There is a name control inside the WPF Border which accepts only a "child element" and contains the same attributes as above: BorderBrush, BorderThickness e BorderRadius. IS Important point out that if you want to use several elements within a Border, it is recommended to use a grid or another "Panel/Container" and within it insert the controls you want. Example Below:

WPF:

<Border BorderBrush="Black" BorderThickness="1" BorderRadius="15">
    <Grid>
        <Label Content="Title"/>
        <Textbox/>
    </Grid
</Border>

For more information on the Border control click here.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.