Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to increase a window's border area for resizing the window with the mouse?

Tags:

c#

windows

wpf

For a simple WPF window, is it possible to increase the area where the mouse can resize the window? For example:

Trial

The border is too thin. I tried the following workarounds but only the edge part of the window acts as an area for resizing:

  1. Increasing BorderThickness of the window
  2. Setting WS_THICKFRAME
like image 679
Garmanarnar Avatar asked Nov 09 '22 00:11

Garmanarnar


1 Answers

You can set WindowStyle="None" and set borderbrush and borderthickness to achieve what you expect.

<Window x:Class="WpfApplication1.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="MainWindow" Height="100" Width="100" WindowStyle="None" BorderThickness="3" BorderBrush="Black" ResizeMode="CanResizeWithGrip" >
 Hello World
</Window>

Hope it works for you!

Or use Wpf custom window, Windows edge resize feature

Wpf custom window, Windows edge resize feature

like image 80
Thiyagu Rajendran Avatar answered Nov 14 '22 23:11

Thiyagu Rajendran