Bunifu Framework Docs
HomePricingFAQsMy Account
  • Introduction
  • Getting started
    • Requirements
    • Installation
    • Installing for .Net 5 & Above
    • Licensing
      • Managing your licenses
      • Bunifu Licensing CLI
      • Bunifu Device Remover (Deprecated)
  • BUNIFU UI
    • Controls
      • Bunifu Button
      • Bunifu Button (variant)
      • Bunifu Cards
      • Bunifu CheckBox
      • Bunifu Circle Progress
      • Bunifu Datagrid View
      • Bunifu Date Picker
      • Bunifu Drop Down
      • Bunifu Flat Button
      • Bunifu Form Caption Button
      • Bunifu Form Control Box
      • Bunifu Form Resize Icon
      • Bunifu Gradient Panel
      • Bunifu Icon Button
      • Bunifu Image Button (New)
      • Bunifu Image Button (Old)
      • Bunifu IOS Switch (1.5.3)
      • Bunifu Label
      • Bunifu Loader
      • Bunifu Picture Box
      • Bunifu Pages
      • Bunifu Panel
      • Bunifu Progress Bar
      • Bunifu Radial Gauge
      • Bunifu Radio Button
      • Bunifu Rating
      • Bunifu Range
      • Bunifu Separator
      • Bunifu Sliders
      • Bunifu Shadow Panel
      • Bunifu Shapes
      • Bunifu Switch (1.5.3)
      • Bunifu ScrollBars
      • Bunifu Toggle Switch
      • Bunifu Toggle Switch (variant)
      • Bunifu Tile Button
      • Bunifu Thin Button (1.5.3)
      • Bunifu ToolTip
      • Bunifu Textbox
      • Bunifu User Control
    • Components
      • Bunifu Color Transition
      • Bunifu Drag
      • Bunifu Elipse [Deprecated]
      • Bunifu Form Dock
      • Bunifu Form Drag
      • Bunifu Form Resizer
      • Bunifu Snackbar
      • Bunifu Transition
  • BUNIFU CHARTS
    • Introduction
      • Quick Tips
    • Chart Components
      • Bunifu Bar Chart
      • Bunifu Bubble Chart
      • Bunifu Canvas Control
      • Bunifu Doughnut Chart
      • Bunifu Horizontal bar Chart
      • Bunifu Line Chart
      • Bunifu Pie chart
      • Bunifu Polar Chart
      • Bunifu Radar Chart
  • BUNIFU DATAVIZ [Deprecated]
    • Basic Charts [Deprecated]
      • Step Line Chart [Deprecated]
      • Step Area Chart [Deprecated]
      • Spline Chart [Deprecated]
      • Pie Chart [Deprecated]
      • Line Chart [Deprecated]
      • Doughnut Chart [Deprecated]
      • Bar Chart [Deprecated]
      • Area Chart [Deprecated]
      • Column Chart [Deprecated]
    • Advanced Charts [Deprecated]
      • Stacked Column 100 Chart [Deprecated]
      • Stacked Column Chart [Deprecated]
      • Stacked Bar Chart 100 [Deprecated]
      • Stacked Bar Chart [Deprecated]
      • Stacked Area Chart 100 [Deprecated]
      • Stacked Area Chart [Deprecated]
      • Scatter Chart [Deprecated]
      • Range Spline Area Chart [Deprecated]
      • Range Column Chart [Deprecated]
      • Range Bar Chart [Deprecated]
      • Range Area Chart [Deprecated]
      • OHLC Chart [Deprecated]
      • Candle Stick Chart [Deprecated]
      • Bubble Chart [Deprecated]
Powered by GitBook
On this page
  • Overview
  • Getting started
  • Adding Bunifu Form Drag at Design Time
  • Handling a Drag Operation with Title Bar.
  • Adding Bunifu Form Drag at Run Time
  • Properties
  • Title Bar Properties
  • Docking Properties
  • Drag Properties

Was this helpful?

  1. BUNIFU UI
  2. Components

Bunifu Form Drag

Make form drag operations easier and in seconds with Bunifu Form Drag

PreviousBunifu Form DockNextBunifu Form Resizer

Last updated 2 years ago

Was this helpful?

Overview

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:

Getting started

Adding Bunifu Form Drag at Design Time

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 FormBorderStyle property to none.

Step 2: Find Bunifu Form Drag in your toolbox and drag it onto your form as shown below:

Note that at this point the form is draggable.

Handling a Drag Operation with Title Bar.

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 pnlTop

Step 2: In the properties of the Bunifu Form Drag component go to the TitleBarOptions property and in the TitleBarControl property 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:

Adding Bunifu Form Drag at Run Time

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
End Sub

Let's take a deep dive and get insights into the available properties on Bunifu Form Drag.

Properties

Title Bar Properties

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.

1. (TitleBarControl)

This property allows you to get or set a control as the main drag control of a form (e.g., Panel, 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.

2. DoubleClickToExpandWindow

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.

3. Enabled

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.

4. UseBackColor

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.

Docking Properties

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:

1. ShowDockingIndicatorsColor

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 DockingIndicatorsColor property. (N.b., The indicator is an outline which shows where the window will be docked to).

2. DockingIndicatorsColor

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 ShowDockingIndicator is set to true.

3. DockingOptions

Property
Description

a) (DockAll)

This property sets a Boolean value which determines if the Windows Form can be docked to either side of the screen display.

b) DockBottomLeft

This property sets a Boolean value which determines if the Windows Form can be docked to the bottom left side of the screen display)

c) DockBottomRight

This property sets a Boolean value which determines if the Windows Form can be docked to the bottom right side of the screen display)

g) DockLeft

This property sets a Boolean value which determines if the Windows Form can be docked to the left side of the screen display)

h) DockRight

This property sets a Boolean value which determines if the Windows Form can be docked to the right side of the screen display)

i) DockTopLeft

This property sets a Boolean value which determines if the Windows Form can be docked to the top-left side of the screen display

j) DockTopRight

This property sets a Boolean value which determines if the Windows Form can be docked to the top-right side of the screen display

4. ShowCursorChange

This property gets or sets a boolean value which when set to true changes the cursor icon from a SizeAll cursor to a SizeNS cursor when about to dock the form. The default value is true

Drag Properties

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:

1. AllowOpacityChanges

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 DragOpacity property.

2. DragOpacity

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.