public class FormDragger : IDisposable
Public Class FormDragger
Implements IDisposable
Dim instance As FormDragger
public ref class FormDragger : IDisposable
type FormDragger =
class
interface IDisposable
end
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
Public Class Form1 : Inherits Form
''' <summary>
''' The <see cref="FormDragger"/> instance that manages the form(s) dragging.
''' </summary>
Friend FormDrag As FormDragger = FormDragger.Empty
Private Sub Test() Handles MyBase.Shown
Me.InitializeDrag()
End Sub
Private Sub InitializeDrag()
' 1st way, using the single-Form constructor:
Me.FormDrag = New FormDragger(Me, enabled:=True, cursor:=Cursors.SizeAll)
' 2nd way, using the multiple-Forms constructor:
' Me.FormDrag = New FormDragger({Me, Form2, form3})
' 3rd way, using the default constructor then adding a Form into the collection:
' Me.FormDrag = New FormDragger
' Me.FormDrag.AddForm(Me, enabled:=True, cursor:=Cursors.SizeAll)
End Sub
''' <summary>
''' Alternates the dragging enabled of the specified form.
''' </summary>
''' <param name="form">The form.</param>
Private Sub AlternateDragEnabled(ByVal form As Form)
Dim formInfo As FormDragInfo = Me.FormDrag.FindFormDragInfo(form)
formInfo.Enabled = Not formInfo.Enabled
End Sub
Private Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) _
Handles Button1.Click
Me.AlternateDragEnabled(Me)
End Sub
End Class
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
FormDragger | Initializes a new instance of the FormDragger class. |
FormDragger(IEnumerableForm) | Initializes a new instance of the FormDragger class. |
FormDragger(Form, Boolean, Cursor) | Initializes a new instance of the FormDragger class. |
Empty | Represents a nul FormDragger instance. |
Forms | Gets an IEnumerableT collection that contains the owner Forms that can perform draggable operations. |
AddControl | Assigns the specified Control as a draggable element. |
AddControls | Assigns the specified controls as draggable elements of they parents Form. |
AddForm | Assigns the specified Form as a draggable element. |
Dispose | Releases all the resources used by this instance. |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object) |
FindFormDragInfo(Control) | Finds the FormDragInfo instance that is associated with the specified Control. |
FindFormDragInfo(Form) | Finds the FormDragInfo instance that is associated with the specified Form. |
FindFormDragInfo(String, StringComparison) | Finds the FormDragInfo instance that is associated with the specified Form. |
GetHashCode | Serves as the default hash function. (Inherited from Object) |
GetType | Gets the Type of the current instance. (Inherited from Object) |
RemoveControl | Removes the specified Control from the draggable elements. |
RemoveControls | Removes the specified controls from the draggable elements. |
RemoveForm | Removes the specified Form from the draggable elements. |
ToString | Returns a string that represents the current object. (Inherited from Object) |
CanConvertTo |
Determines whether the source object can be converted to the specified target type.
(Defined by ObjectExtensions) |
CanConvertToT |
Determines whether the source object can be converted to the specified target type.
(Defined by ObjectExtensions) |
ConvertToT |
Converts an object to the specified target type.
If the conversion fails, an exception is thrown.
(Defined by ObjectExtensions) |
ConvertToT |
Converts an object to the specified target type.
If the conversion fails, returns the specified default value.
(Defined by ObjectExtensions) |
IsDisposable |
Determines whether the specified object is a disposable type
(i.e., it implements IDisposable interface).
(Defined by ObjectExtensions) |
Speak |
Speaks the string representation of the source object by using the
operating system integrated text-to-speech synthesizer.
(Defined by ObjectExtensions) |
Speak |
Speaks the string representation of the source object by using the
operating system integrated text-to-speech synthesizer.
(Defined by ObjectExtensions) |
ThrowIfNullTException |
Throws the specified exception if the source object is null.
(Defined by ObjectExtensions) |