Add resize capabilities to a borderless Windows Form.
Bunifu Form Resizer is a component that lets you resize a borderless form to your desired size preference. Cherry on the cake: it works out of the box — no C# code is needed to make it work.
A demo is worth a thousand words:-
To resize the Windows Form, we have to hover on any of the edges or borders of the Windows Form, select and resize it by using its handle (grip).The component provides a couple of properties, which are all documented here.
Adding Bunifu Form Resizer at Design Time
It is easy to add a Bunifu Form Resizer at the designer level.
Step 1: First, make sure that the Windows Form is borderless. This can be done either by setting the FormBorderStyle property to none. Also, ensure the form has a padding of at least 1
Step 2: Find Bunifu Form Resizer in your toolbox and drag it onto your form as shown below:
It is worth noting that at this point the Windows Form is resizable.
Optional step: You can add a resize icon on the bottom right corner of Windows Form indicating that it is a resizable window. To add the icon, search for Bunifu Form Resize Icon and drag and place it on the bottom right corner of the form as shown below:
Adding Bunifu Form Resizer at Run Time
To add a Bunifu Form Resizer on our form at run-time, use the constructor of your form to run the following code:-
Let's take a deep dive and get insights into the available properties on Bunifu Form Resizer
This property gets and sets the width of the Window resize handle (i.e. the resize cursor types of SizeNS, SizeNESW, SizeNWSE and SizeWE). The larger the value, the larger the width of the cursor handle.
This property gets and sets a boolean value which determines if the the resize functionality works on the form. A false value disables resizing events on the borderless Windows Form.