/// <summary>
 /// Raises the <see cref="E:System.Windows.Forms.Control.Resize" /> event.
 /// </summary>
 /// <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param>
 protected override void OnResize(EventArgs e)
 {
     Width    = (Height - 2) * 2;
     diameter = Width / 2;
     artis    = 4 * diameter / 30;
     rect     = new RoundedRectangleF(2 * diameter, diameter + 2, diameter / 2, 1, 1);
     circle   = new RectangleF(!isOn ? 1 : Width - diameter - 1, 1, diameter, diameter);
     base.OnResize(e);
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="ZeroitKokonsaSwitch"/> class.
        /// </summary>
        public ZeroitKokonsaSwitch()
        {
            Cursor         = Cursors.Hand;
            DoubleBuffered = true;

            artis       = 4; //increment for sliding animation
            diameter    = 30;
            textEnabled = true;
            rect        = new RoundedRectangleF(2 * diameter, diameter + 2, diameter / 2, 1, 1);
            circle      = new RectangleF(1, 1, diameter, diameter);
            isOn        = true;
            borderColor = Color.LightGray;

            paintTicker.Tick    += paintTicker_Tick;
            paintTicker.Interval = 1;
        }