Inheritance: System.Windows.Forms.Form
Exemple #1
0
        public FormDrop(SuperNotifyIcon owner, bool debug)
        {
            InitializeComponent();

            // Blah
            _owner  = owner;
            Visible = false;

            // Debug
            if (debug)
            {
                _debug       = true;
                formDebugger = new FormDebugger();
                OwnApplicationActive(); // blah
                formDebugger.Show();
            }

            // Keeping on top of things
            ControlBox      = false;
            MinimizeBox     = false;
            MaximizeBox     = false;
            FormBorderStyle = FormBorderStyle.FixedToolWindow;
            Text            = "";
            Deactivate     += (sender2, e2) => Activate();
            VisibleChanged += (sender2, e2) => WindowState = FormWindowState.Normal;
            SizeChanged    += (sender2, e2) => WindowState = FormWindowState.Normal;

            // We don't want to be obvious!
            ShowInTaskbar = false;
            if (!debug)
            {
                Opacity = 0.005;
            }

            // Drop support
            AllowDrop   = true;
            DragLeave  += (sender2, e2) => TopMost = false;
            MouseEnter += (sender2, e2) => TopMost = false;
            MouseLeave += (sender2, e2) => TopMost = false;

            // Drop events
            DragDrop  += _owner.HandleDragDrop;
            DragEnter += _owner.HandleDragEnter;
            DragLeave += _owner.HandleDragLeave;
            DragOver  += _owner.HandleDragOver;

            // Whether the left mouse button is down
            MouseHook.MouseDown += (sender2, e2) => mouseLeftDown = e2.Button == MouseButtons.Left;
            MouseHook.MouseUp   += (sender2, e2) => mouseLeftDown = false;

            // And now to initialise the behaviour...
            Init();
            ShowDrop();
        }
Exemple #2
0
        public FormDrop(SuperNotifyIcon owner, bool debug)
        {
            InitializeComponent();

            // Blah
            _owner = owner;
            Visible = false;

            // Debug
            if (debug)
            {
                _debug = true;
                formDebugger = new FormDebugger();
                OwnApplicationActive(); // blah
                formDebugger.Show();
            }

            // Keeping on top of things
            ControlBox = false;
            MinimizeBox = false;
            MaximizeBox = false;
            FormBorderStyle = FormBorderStyle.FixedToolWindow;
            Text = "";
            Deactivate += (sender2, e2) => Activate();
            VisibleChanged += (sender2, e2) => WindowState = FormWindowState.Normal;
            SizeChanged +=(sender2, e2) => WindowState = FormWindowState.Normal;

            // We don't want to be obvious!
            ShowInTaskbar = false;
            if (!debug)
                Opacity = 0.005;

            // Drop support
            AllowDrop = true;
            DragLeave += (sender2, e2) => TopMost = false;
            MouseEnter += (sender2, e2) => TopMost = false;
            MouseLeave += (sender2, e2) => TopMost = false;

            // Drop events
            DragDrop += _owner.HandleDragDrop;
            DragEnter += _owner.HandleDragEnter;
            DragLeave += _owner.HandleDragLeave;
            DragOver += _owner.HandleDragOver;

            // Whether the left mouse button is down
            MouseHook.MouseDown += (sender2, e2) => mouseLeftDown = e2.Button == MouseButtons.Left;
            MouseHook.MouseUp += (sender2, e2) => mouseLeftDown = false;

            // And now to initialise the behaviour...
            Init();
            ShowDrop();
        }