예제 #1
0
        /// <summary>
        /// Event: Performs important initialization routines when the form is first loaded.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">Empty event data.</param>
        private void EventFlashingFormLoad(object sender, EventArgs e)
        {
            // Initialize the flashing timer and stopwatch
            this.flashingTimer = new System.Timers.Timer(Properties.Settings.Default.FlashingInterval)
            {
                AutoReset = false, SynchronizingObject = this
            };
            this.flashingTimer.Elapsed += this.EventFlashingTimerElapsed;
            this.flashingStopwatch      = new Stopwatch();

            // Initialize the default flashing color list
            this.flashingColorsList        = new List <Color>();
            this.currentFlashingColorIndex = 0;
            this.UpdateFlashingColorsList();

            // Update the auto close time
            this.UpdateAutoCloseTime();

            // Set the form size to the previously saved size (to allow even 1x1 saved form sizes)
            this.Size = this.savedSize;

            // Update the notify icon
            this.notifyIcon.Icon = this.Icon;

            // Assign the context menu
            this.ContextMenu            = this.contextMenu;
            this.notifyIcon.ContextMenu = this.contextMenu;

            // Make the repair form moveable and resizeable with the mouse
            RestlessControlMaker.Make(this).FullBodyCursor = Cursors.Cross;
        }
예제 #2
0
 /// <summary>
 /// Starts moving the restless control on demand.
 /// </summary>
 /// <param name="control">The restless control.</param>
 public static void StartMoving(Control control)
 {
     RestlessControlMaker.DoSysCommand(control, (IntPtr)NativeMethods.SC_MOVE);
 }