Cabster/Extensions/ControlAbleToMoveWithMouseExtensions.cs
/// <summary>
///     Torna um controle capaz ser movido pelo mouse.
/// </summary>
/// <param name="control">Controle.</param>
/// <param name="enable">Modo.</param>
Torna um controle capaz ser movido pelo mouse.
Torna um controle capaz ser movido pelo mouse .
public static T MakeAbleToMoveWithMouse<T>(this T control, bool enable = true) where T : Control
        {
            var containsKey = Forms.ContainsKey(control);
            if (!containsKey && !enable) return control;
            if (!containsKey) Forms.Add(control, new MakeAbleToMoveWithMouseInfo(control));
            Forms[control].Enable(enable);
            if (!enable) Forms.Remove(control);
            return control;
        }
public static T MakeAbleToMoveWithMouse < T > ( this T control , bool enable = true ) where T : Control { var containsKey = Forms . ContainsKey ( control ) ; if ( ! containsKey && ! enable ) return control ; if ( ! containsKey ) Forms . Add ( control , new MakeAbleToMoveWithMouseInfo ( control ) ) ; Forms [ control ] . Enable ( enable ) ; if ( ! enable ) Forms . Remove ( control ) ; return control ; }
Torna um controle capaz ser movido pelo mouse.
Torna um controle capaz ser movido pelo mouse .
T
this
enable
bool
None
control
None