Bunifu Form Drag
Make form drag operations easier and in seconds with Bunifu Form Drag
Bunifu Form Drag is a component designed to bring you seamless integration of drag operations on borderless forms to some desired target on your windows screen. Here is an illustration of this component in action:
It is quite easy to add a Bunifu form drag at the designer level.
Step 1: First, make sure that the form is borderless. This can be done either by setting the
Step 2: Find Bunifu Form Drag in your toolbox and drag it onto your form as shown below:
Step 1: First, create a title bar. This can be done by placing a panel and docking it to the top area of the form as shown below. You can name it as
Step 2: In the properties of the Bunifu Form Drag component go to the
TitleBarOptionsproperty and in the
TitleBarControlproperty set it with the pnlTop control as its value.
Step 3: Finally run the application. You have now successfully added a drag operation for a non-borderless form:
To add a Bunifu Form Drag on our form at run-time, use the Load event handler of your form to run the following code:
private void Form1_Load(object sender, EventArgs e)
BunifuFormDrag bunifuFormDrag = new BunifuFormDrag();
bunifuFormDrag.ContainerControl = this;
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)
Dim bunifuFormDrag As New BunifuFormDrag()
bunifuFormDrag.ContainerControl = Me
To initiate the drag interaction, this property enables you to select your desired form control (i.e., the title bar e.g, a panel) as an object to initiate a drag operation and apply Drag and Windows Form effects. It contains a list of interactivity options for control set as a title bar of a form.
This property allows you to get or set a control as the main drag control of a form (e.g.,
BunifuPanel, etc...) which will be used to move the form to the desired location on the screen. This control is "normally" docked/anchored on the top part of the Window Form.
This property enables you to maximize your Window Form by the operation of double-clicking the control set as a title bar / main-drag control.
This property sets a Boolean value that determines whether a user can perform drag operations on a Windows Form using the title bar. A value of True enables drag operations using the control set as the title bar and a value of False disables the use of the title bar control for drag operations.
This property gets or sets a Boolean value indicating whether during a docking operation the back colour will be used as a semi-transparent outline which shows where the window will be docked if you release the mouse button at that point.
You can set/get the look and feel of the borderless form while docking (i.e., pinning it to the desired location). This could be accomplished by simply dragging the window title bar toward the desktop corners versus the sides. (N.B., the windows form could dock 1/2 or 1/4 size windows vertically or horizontally.
Here is the list of properties to checkout while setting the docking effects:
This property sets and gets a boolean value which when set to true, will override the default windows docking colour and apply the custom colour set in the
DockingIndicatorsColorproperty. (N.b., The indicator is an outline which shows where the window will be docked to).
This property allows you to get or set the docking indicator colour. It supports the use of HEX, RGB, and ARGB colour formats. (N.b., this only works when the
ShowDockingIndicatoris set to true.
This property gets or sets a boolean value which when set to true changes the cursor icon from a
SizeAllcursor to a
SizeNScursor when about to dock the form. The default value is true
You can set/get the look and feel of the borderless form while dragging the form to the desired location on the screen. Dragging involves the operation where:
- Users acquire the title bar using the mouse on a mouse click
- While keeping the title bar selected (i.e., by continuous pressure on the mouse button), the user then moves the pointing device to some desired target. This is the “drag” part of the operation.
- Finally, the user deselects the title bar — by letting go of the mouse button. This is the “drop” step.
Here are the properties to check-out in the drag properties:
This property gets or sets a boolean value which when set to true applies an opacity to the form while dragging the form to a desired area in the display. The opacity value is determined by the
This property gets or sets a percentage value which determines the transparency rate of the form while dragging it to a particular location. The lower the percentage, the higher the transparency view of the form will be while on a drag operation.