Quellcode durchsuchen

Закругления на форме авторизации

Вячеслав Терешенко vor 2 Jahren
Ursprung
Commit
1336535779

+ 36 - 0
ImpulseVision/Card.Designer.cs

@@ -0,0 +1,36 @@
+namespace ImpulseVision
+{
+    partial class Card
+    {
+        /// <summary> 
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary> 
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        //protected override void Dispose(bool disposing)
+        //{
+        //    if (disposing && (components != null))
+        //    {
+        //        components.Dispose();
+        //    }
+        //    base.Dispose(disposing);
+        //}
+
+        #region Component Designer generated code
+
+        /// <summary> 
+        /// Required method for Designer support - do not modify 
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            components = new System.ComponentModel.Container();
+        }
+
+        #endregion
+    }
+}

+ 168 - 0
ImpulseVision/Card.cs

@@ -0,0 +1,168 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Drawing.Drawing2D;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace ImpulseVision
+{
+    public class FDCard : Control
+    {
+        #region -- Переменные --
+
+        Animation animCurtain;
+        private float CurtainHeight;
+        private int CurtainMinHeight = 50;
+
+        private bool MouseEntered = false;
+        private bool MousePressed = false;
+
+        StringFormat SF = new StringFormat();
+
+        #endregion
+
+        #region -- Свойства --
+
+        public string TextHeader { get; set; } = "Header";
+        public Font FontHeader { get; set; } = new Font("Verdana", 12F, FontStyle.Bold);
+        public Color ForeColorHeader { get; set; } = Color.White;
+
+        public string TextDescrition { get; set; } = "Your description text for this control";
+        public Font FontDescrition { get; set; } = new Font("Verdana", 8.25F, FontStyle.Regular);
+        public Color ForeColorDescrition { get; set; } = Color.Black;
+
+        public Color BackColorCurtain { get; set; } = FlatColors.Red;
+
+        #endregion
+
+        public FDCard()
+        {
+            SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw | ControlStyles.SupportsTransparentBackColor | ControlStyles.UserPaint, true);
+            DoubleBuffered = true;
+
+            Size = new Size(250, 200);
+            CurtainHeight = Height - 60;
+
+            Font = new Font("Verdana", 9F, FontStyle.Regular);
+            BackColor = Color.White;
+
+            animCurtain = new Animation();
+            animCurtain.Value = CurtainHeight;
+
+            SF.Alignment = StringAlignment.Near;
+            SF.LineAlignment = StringAlignment.Near;
+
+            Cursor = Cursors.Hand;
+        }
+
+        protected override void OnPaint(PaintEventArgs e)
+        {
+            base.OnPaint(e);
+
+            Graphics graph = e.Graphics;
+            graph.SmoothingMode = SmoothingMode.HighQuality;
+
+            graph.Clear(Parent.BackColor);
+
+            Rectangle rect = new Rectangle(0, 0, Width - 1, Height - 1);
+            Rectangle rectCurtain = new Rectangle(0, 0, Width - 1, (int)animCurtain.Value);
+            Rectangle rectDescription = new Rectangle(15, CurtainMinHeight + 5, rect.Width - 30, rect.Height - 100);
+
+            //Фон
+            graph.FillRectangle(new SolidBrush(BackColor), rect);
+
+            //Шторка
+            graph.DrawRectangle(new Pen(BackColorCurtain), rectCurtain);
+            graph.FillRectangle(new SolidBrush(BackColorCurtain), rectCurtain);
+
+            //Обводка
+            //graph.DrawRectangle(new Pen(FlatColors.Gray), rect);
+
+            if (animCurtain.Value == CurtainMinHeight)
+            {
+                graph.DrawString(TextDescrition, FontDescrition, new SolidBrush(ForeColorDescrition), rectDescription, SF);
+                //debug: //graph.DrawRectangle(new Pen(Color.Blue), rectDescription);
+            }
+
+            graph.DrawString(Text, Font, new SolidBrush(ForeColor), 15, Height - 37);
+            graph.DrawString(TextHeader, FontHeader, new SolidBrush(ForeColorHeader),
+                new Rectangle(15, 15, rectCurtain.Width, rectCurtain.Height));
+        }
+
+        protected override void OnSizeChanged(EventArgs e)
+        {
+            base.OnSizeChanged(e);
+
+            if (Height <= 100)
+                Height = 100;
+            if (Width <= 100)
+                Width = 100;
+
+            CurtainHeight = Height - 60;
+
+            animCurtain = new Animation();
+            animCurtain.Value = CurtainHeight;
+
+            Invalidate();
+        }
+
+        protected override void OnMouseEnter(EventArgs e)
+        {
+            base.OnMouseEnter(e);
+
+            MouseEntered = true;
+
+            DoCurtainAnimation();
+
+            //Invalidate();
+        }
+
+        protected override void OnMouseLeave(EventArgs e)
+        {
+            base.OnMouseLeave(e);
+
+            MouseEntered = false;
+
+            DoCurtainAnimation();
+
+            //Invalidate();
+        }
+
+        protected override void OnMouseDown(MouseEventArgs e)
+        {
+            base.OnMouseDown(e);
+
+            MousePressed = true;
+
+            Invalidate();
+        }
+
+        protected override void OnMouseUp(MouseEventArgs e)
+        {
+            base.OnMouseUp(e);
+
+            MousePressed = false;
+
+            Invalidate();
+        }
+
+        private void DoCurtainAnimation()
+        {
+            if (MouseEntered == true)
+            {
+                animCurtain = new Animation("Curtain_" + Handle, Invalidate, animCurtain.Value, CurtainMinHeight);
+            }
+            else
+            {
+                animCurtain = new Animation("Curtain_" + Handle, Invalidate, animCurtain.Value, CurtainHeight);
+            }
+
+            Animator.Request(animCurtain, true);
+        }
+    }
+}

+ 80 - 70
ImpulseVision/FormAutorize.Designer.cs

@@ -29,67 +29,50 @@
         private void InitializeComponent()
         {
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormAutorize));
-            this.label1 = new System.Windows.Forms.Label();
             this.BtnLogin = new System.Windows.Forms.Button();
-            this.yt_Button1 = new ImpulseVision.yt_Button();
-            this.TbxLogin = new ImpulseVision.EgoldsGoogleTextBox();
             this.TbxPassword = new ImpulseVision.EgoldsGoogleTextBox();
+            this.TbxLogin = new ImpulseVision.EgoldsGoogleTextBox();
+            this.Card = new ImpulseVision.FDCard();
+            this.PanelAutorize = new ImpulseVision.RPanel();
+            this.PanelAutorize.SuspendLayout();
             this.SuspendLayout();
             // 
-            // label1
-            // 
-            this.label1.AutoSize = true;
-            this.label1.Font = new System.Drawing.Font("Segoe UI Variable Small Semibol", 18F, System.Drawing.FontStyle.Bold);
-            this.label1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(43)))), ((int)(((byte)(45)))), ((int)(((byte)(66)))));
-            this.label1.Location = new System.Drawing.Point(22, 9);
-            this.label1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
-            this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(168, 32);
-            this.label1.TabIndex = 0;
-            this.label1.Text = "Авторизация";
-            // 
             // BtnLogin
             // 
             this.BtnLogin.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(124)))), ((int)(((byte)(136)))), ((int)(((byte)(144)))));
             this.BtnLogin.Font = new System.Drawing.Font("Segoe UI Variable Small Semibol", 12F, System.Drawing.FontStyle.Bold);
             this.BtnLogin.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(246)))), ((int)(((byte)(255)))), ((int)(((byte)(248)))));
-            this.BtnLogin.Location = new System.Drawing.Point(38, 161);
+            this.BtnLogin.Location = new System.Drawing.Point(323, 185);
             this.BtnLogin.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
             this.BtnLogin.Name = "BtnLogin";
             this.BtnLogin.Size = new System.Drawing.Size(152, 35);
-            this.BtnLogin.TabIndex = 5;
+            this.BtnLogin.TabIndex = 3;
             this.BtnLogin.Text = "Войти";
             this.BtnLogin.UseVisualStyleBackColor = false;
             this.BtnLogin.Click += new System.EventHandler(this.BtnLogin_Click);
             // 
-            // yt_Button1
+            // TbxPassword
             // 
-            this.yt_Button1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(166)))), ((int)(((byte)(43)))));
-            this.yt_Button1.BackColorAdditional = System.Drawing.Color.FromArgb(((int)(((byte)(200)))), ((int)(((byte)(162)))), ((int)(((byte)(200)))));
-            this.yt_Button1.BackColorGradientEnabled = true;
-            this.yt_Button1.BackColorGradientMode = System.Drawing.Drawing2D.LinearGradientMode.ForwardDiagonal;
-            this.yt_Button1.BorderColor = System.Drawing.Color.Tomato;
-            this.yt_Button1.BorderColorEnabled = false;
-            this.yt_Button1.BorderColorOnHover = System.Drawing.Color.Tomato;
-            this.yt_Button1.BorderColorOnHoverEnabled = false;
-            this.yt_Button1.Cursor = System.Windows.Forms.Cursors.Hand;
-            this.yt_Button1.Font = new System.Drawing.Font("Segoe UI Variable Small Semibol", 12F, System.Drawing.FontStyle.Bold);
-            this.yt_Button1.ForeColor = System.Drawing.Color.White;
-            this.yt_Button1.Location = new System.Drawing.Point(38, 213);
-            this.yt_Button1.Name = "yt_Button1";
-            this.yt_Button1.RippleColor = System.Drawing.Color.Black;
-            this.yt_Button1.RoundingEnable = true;
-            this.yt_Button1.Size = new System.Drawing.Size(152, 35);
-            this.yt_Button1.TabIndex = 6;
-            this.yt_Button1.Text = "Войти";
-            this.yt_Button1.TextHover = null;
-            this.yt_Button1.UseDownPressEffectOnClick = false;
-            this.yt_Button1.UseRippleEffect = true;
-            this.yt_Button1.UseVisualStyleBackColor = false;
-            this.yt_Button1.UseZoomEffectOnHover = false;
+            this.TbxPassword.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+            this.TbxPassword.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(225)))), ((int)(((byte)(240)))), ((int)(((byte)(244)))));
+            this.TbxPassword.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(89)))), ((int)(((byte)(60)))), ((int)(((byte)(143)))));
+            this.TbxPassword.BorderColorNotActive = System.Drawing.Color.FromArgb(((int)(((byte)(124)))), ((int)(((byte)(136)))), ((int)(((byte)(144)))));
+            this.TbxPassword.Cursor = System.Windows.Forms.Cursors.IBeam;
+            this.TbxPassword.Font = new System.Drawing.Font("Segoe UI Variable Small Semibol", 12F, System.Drawing.FontStyle.Bold);
+            this.TbxPassword.FontTextPreview = new System.Drawing.Font("Arial", 8F, System.Drawing.FontStyle.Bold);
+            this.TbxPassword.ForeColor = System.Drawing.Color.Black;
+            this.TbxPassword.Location = new System.Drawing.Point(291, 105);
+            this.TbxPassword.Name = "TbxPassword";
+            this.TbxPassword.SelectionStart = 0;
+            this.TbxPassword.Size = new System.Drawing.Size(210, 40);
+            this.TbxPassword.TabIndex = 2;
+            this.TbxPassword.TextInput = "";
+            this.TbxPassword.TextPreview = "Пароль";
+            this.TbxPassword.UseSystemPasswordChar = false;
             // 
             // TbxLogin
             // 
+            this.TbxLogin.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
             this.TbxLogin.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(225)))), ((int)(((byte)(240)))), ((int)(((byte)(244)))));
             this.TbxLogin.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(89)))), ((int)(((byte)(60)))), ((int)(((byte)(143)))));
             this.TbxLogin.BorderColorNotActive = System.Drawing.Color.FromArgb(((int)(((byte)(124)))), ((int)(((byte)(136)))), ((int)(((byte)(144)))));
@@ -97,44 +80,72 @@
             this.TbxLogin.Font = new System.Drawing.Font("Segoe UI Variable Small Semibol", 12F, System.Drawing.FontStyle.Bold);
             this.TbxLogin.FontTextPreview = new System.Drawing.Font("Arial", 8F, System.Drawing.FontStyle.Bold);
             this.TbxLogin.ForeColor = System.Drawing.Color.Black;
-            this.TbxLogin.Location = new System.Drawing.Point(13, 69);
+            this.TbxLogin.Location = new System.Drawing.Point(291, 59);
             this.TbxLogin.Name = "TbxLogin";
             this.TbxLogin.SelectionStart = 0;
             this.TbxLogin.Size = new System.Drawing.Size(210, 40);
-            this.TbxLogin.TabIndex = 7;
+            this.TbxLogin.TabIndex = 1;
             this.TbxLogin.TextInput = "";
             this.TbxLogin.TextPreview = "Логин";
             this.TbxLogin.UseSystemPasswordChar = false;
             // 
-            // TbxPassword
+            // Card
             // 
-            this.TbxPassword.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(225)))), ((int)(((byte)(240)))), ((int)(((byte)(244)))));
-            this.TbxPassword.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(89)))), ((int)(((byte)(60)))), ((int)(((byte)(143)))));
-            this.TbxPassword.BorderColorNotActive = System.Drawing.Color.FromArgb(((int)(((byte)(124)))), ((int)(((byte)(136)))), ((int)(((byte)(144)))));
-            this.TbxPassword.Cursor = System.Windows.Forms.Cursors.IBeam;
-            this.TbxPassword.Font = new System.Drawing.Font("Segoe UI Variable Small Semibol", 12F, System.Drawing.FontStyle.Bold);
-            this.TbxPassword.FontTextPreview = new System.Drawing.Font("Arial", 8F, System.Drawing.FontStyle.Bold);
-            this.TbxPassword.ForeColor = System.Drawing.Color.Black;
-            this.TbxPassword.Location = new System.Drawing.Point(13, 115);
-            this.TbxPassword.Name = "TbxPassword";
-            this.TbxPassword.SelectionStart = 0;
-            this.TbxPassword.Size = new System.Drawing.Size(210, 40);
-            this.TbxPassword.TabIndex = 8;
-            this.TbxPassword.TextInput = "";
-            this.TbxPassword.TextPreview = "Пароль";
-            this.TbxPassword.UseSystemPasswordChar = false;
+            this.Card.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(253)))), ((int)(((byte)(255)))), ((int)(((byte)(252)))));
+            this.Card.BackColorCurtain = System.Drawing.Color.FromArgb(((int)(((byte)(73)))), ((int)(((byte)(104)))), ((int)(((byte)(112)))));
+            this.Card.Cursor = System.Windows.Forms.Cursors.Hand;
+            this.Card.Dock = System.Windows.Forms.DockStyle.Left;
+            this.Card.Font = new System.Drawing.Font("Segoe UI Variable Small Semibol", 12F, System.Drawing.FontStyle.Bold);
+            this.Card.FontDescrition = new System.Drawing.Font("Segoe UI Variable Small Semibol", 12F, System.Drawing.FontStyle.Bold);
+            this.Card.FontHeader = new System.Drawing.Font("Segoe UI Variable Small Semibol", 18F, System.Drawing.FontStyle.Bold);
+            this.Card.ForeColor = System.Drawing.Color.Black;
+            this.Card.ForeColorDescrition = System.Drawing.Color.Black;
+            this.Card.ForeColorHeader = System.Drawing.Color.FromArgb(((int)(((byte)(253)))), ((int)(((byte)(255)))), ((int)(((byte)(252)))));
+            this.Card.Location = new System.Drawing.Point(0, 0);
+            this.Card.Name = "Card";
+            this.Card.Size = new System.Drawing.Size(261, 274);
+            this.Card.TabIndex = 0;
+            this.Card.Text = "Создать аккаунт";
+            this.Card.TextDescrition = "Your description text for this control";
+            this.Card.TextHeader = "Авторизация";
+            // 
+            // PanelAutorize
+            // 
+            this.PanelAutorize.Anchor = System.Windows.Forms.AnchorStyles.None;
+            this.PanelAutorize.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(171)))), ((int)(((byte)(188)))), ((int)(((byte)(193)))));
+            this.PanelAutorize.BackColorAdditional = System.Drawing.Color.FromArgb(((int)(((byte)(73)))), ((int)(((byte)(104)))), ((int)(((byte)(112)))));
+            this.PanelAutorize.BackColorGradientEnabled = false;
+            this.PanelAutorize.BackColorGradientMode = System.Drawing.Drawing2D.LinearGradientMode.Horizontal;
+            this.PanelAutorize.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(73)))), ((int)(((byte)(104)))), ((int)(((byte)(112)))));
+            this.PanelAutorize.BorderColorEnabled = false;
+            this.PanelAutorize.BorderColorOnHover = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(229)))), ((int)(((byte)(233)))));
+            this.PanelAutorize.BorderColorOnHoverEnabled = false;
+            this.PanelAutorize.Controls.Add(this.Card);
+            this.PanelAutorize.Controls.Add(this.TbxLogin);
+            this.PanelAutorize.Controls.Add(this.BtnLogin);
+            this.PanelAutorize.Controls.Add(this.TbxPassword);
+            this.PanelAutorize.Cursor = System.Windows.Forms.Cursors.Hand;
+            this.PanelAutorize.Font = new System.Drawing.Font("Verdana", 8.25F);
+            this.PanelAutorize.ForeColor = System.Drawing.Color.White;
+            this.PanelAutorize.Location = new System.Drawing.Point(79, 51);
+            this.PanelAutorize.Name = "PanelAutorize";
+            this.PanelAutorize.RippleColor = System.Drawing.Color.Black;
+            this.PanelAutorize.Rounding = 10;
+            this.PanelAutorize.RoundingEnable = true;
+            this.PanelAutorize.Size = new System.Drawing.Size(538, 274);
+            this.PanelAutorize.TabIndex = 10;
+            this.PanelAutorize.TextHover = null;
+            this.PanelAutorize.UseDownPressEffectOnClick = false;
+            this.PanelAutorize.UseRippleEffect = true;
+            this.PanelAutorize.UseZoomEffectOnHover = false;
             // 
             // FormAutorize
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 21F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(225)))), ((int)(((byte)(240)))), ((int)(((byte)(244)))));
-            this.ClientSize = new System.Drawing.Size(507, 299);
-            this.Controls.Add(this.TbxPassword);
-            this.Controls.Add(this.TbxLogin);
-            this.Controls.Add(this.yt_Button1);
-            this.Controls.Add(this.BtnLogin);
-            this.Controls.Add(this.label1);
+            this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(24)))), ((int)(((byte)(62)))), ((int)(((byte)(71)))));
+            this.ClientSize = new System.Drawing.Size(690, 390);
+            this.Controls.Add(this.PanelAutorize);
             this.Font = new System.Drawing.Font("Segoe UI", 12F);
             this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
             this.Margin = new System.Windows.Forms.Padding(5, 4, 5, 4);
@@ -143,17 +154,16 @@
             this.Text = "ImpulseVision";
             this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FormAutorize_FormClosing);
             this.Load += new System.EventHandler(this.FormAutorize_Load);
+            this.PanelAutorize.ResumeLayout(false);
             this.ResumeLayout(false);
-            this.PerformLayout();
 
         }
 
         #endregion
-
-        private System.Windows.Forms.Label label1;
         private System.Windows.Forms.Button BtnLogin;
-        private yt_Button yt_Button1;
         private EgoldsGoogleTextBox TbxLogin;
         private EgoldsGoogleTextBox TbxPassword;
+        private FDCard Card;
+        private RPanel PanelAutorize;
     }
 }

+ 36 - 19
ImpulseVision/FormMain.Designer.cs

@@ -67,6 +67,7 @@
             this.TableLayoutWorks = new System.Windows.Forms.TableLayoutPanel();
             this.PbxEther = new System.Windows.Forms.PictureBox();
             this.panel1 = new System.Windows.Forms.Panel();
+            this.TbxName = new ImpulseVision.EgoldsGoogleTextBox();
             this.label1 = new System.Windows.Forms.Label();
             this.BtnSave = new System.Windows.Forms.Button();
             this.TbSettings = new System.Windows.Forms.TabPage();
@@ -75,7 +76,7 @@
             this.label4 = new System.Windows.Forms.Label();
             this.LswView = new System.Windows.Forms.ListView();
             this.ImList = new System.Windows.Forms.ImageList(this.components);
-            this.TbxName = new ImpulseVision.EgoldsGoogleTextBox();
+            this.SwSavePositionForm = new ImpulseVision.EgoldsToggleSwitch();
             this.menuStrip1.SuspendLayout();
             this.ToolsMenu.SuspendLayout();
             this.statusStrip1.SuspendLayout();
@@ -423,6 +424,24 @@
             this.panel1.Size = new System.Drawing.Size(250, 273);
             this.panel1.TabIndex = 0;
             // 
+            // TbxName
+            // 
+            this.TbxName.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(253)))), ((int)(((byte)(255)))), ((int)(((byte)(252)))));
+            this.TbxName.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(137)))), ((int)(((byte)(60)))), ((int)(((byte)(143)))));
+            this.TbxName.BorderColorNotActive = System.Drawing.Color.FromArgb(((int)(((byte)(124)))), ((int)(((byte)(136)))), ((int)(((byte)(144)))));
+            this.TbxName.Cursor = System.Windows.Forms.Cursors.IBeam;
+            this.TbxName.Font = new System.Drawing.Font("Segoe UI Variable Small Semibol", 12F, System.Drawing.FontStyle.Bold);
+            this.TbxName.FontTextPreview = new System.Drawing.Font("Arial", 8F, System.Drawing.FontStyle.Bold);
+            this.TbxName.ForeColor = System.Drawing.Color.Black;
+            this.TbxName.Location = new System.Drawing.Point(7, 28);
+            this.TbxName.Name = "TbxName";
+            this.TbxName.SelectionStart = 0;
+            this.TbxName.Size = new System.Drawing.Size(236, 40);
+            this.TbxName.TabIndex = 4;
+            this.TbxName.TextInput = "";
+            this.TbxName.TextPreview = "Имя пользователя";
+            this.TbxName.UseSystemPasswordChar = false;
+            // 
             // label1
             // 
             this.label1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(227)))), ((int)(((byte)(222)))));
@@ -450,7 +469,8 @@
             // 
             // TbSettings
             // 
-            this.TbSettings.BackColor = System.Drawing.Color.White;
+            this.TbSettings.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(253)))), ((int)(((byte)(255)))), ((int)(((byte)(252)))));
+            this.TbSettings.Controls.Add(this.SwSavePositionForm);
             this.TbSettings.Controls.Add(this.label3);
             this.TbSettings.Location = new System.Drawing.Point(4, 30);
             this.TbSettings.Name = "TbSettings";
@@ -518,29 +538,25 @@
             this.ImList.ImageSize = new System.Drawing.Size(100, 100);
             this.ImList.TransparentColor = System.Drawing.Color.Transparent;
             // 
-            // TbxName
+            // SwSavePositionForm
             // 
-            this.TbxName.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(246)))), ((int)(((byte)(255)))), ((int)(((byte)(248)))));
-            this.TbxName.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(137)))), ((int)(((byte)(60)))), ((int)(((byte)(143)))));
-            this.TbxName.BorderColorNotActive = System.Drawing.Color.FromArgb(((int)(((byte)(124)))), ((int)(((byte)(136)))), ((int)(((byte)(144)))));
-            this.TbxName.Cursor = System.Windows.Forms.Cursors.IBeam;
-            this.TbxName.Font = new System.Drawing.Font("Segoe UI Variable Small Semibol", 12F, System.Drawing.FontStyle.Bold);
-            this.TbxName.FontTextPreview = new System.Drawing.Font("Arial", 8F, System.Drawing.FontStyle.Bold);
-            this.TbxName.ForeColor = System.Drawing.Color.Black;
-            this.TbxName.Location = new System.Drawing.Point(7, 28);
-            this.TbxName.Name = "TbxName";
-            this.TbxName.SelectionStart = 0;
-            this.TbxName.Size = new System.Drawing.Size(236, 40);
-            this.TbxName.TabIndex = 4;
-            this.TbxName.TextInput = "";
-            this.TbxName.TextPreview = "Имя пользователя";
-            this.TbxName.UseSystemPasswordChar = false;
+            this.SwSavePositionForm.BackColor = System.Drawing.Color.White;
+            this.SwSavePositionForm.BackColorOFF = System.Drawing.Color.Silver;
+            this.SwSavePositionForm.BackColorON = System.Drawing.Color.LimeGreen;
+            this.SwSavePositionForm.Checked = false;
+            this.SwSavePositionForm.Cursor = System.Windows.Forms.Cursors.Hand;
+            this.SwSavePositionForm.Font = new System.Drawing.Font("Segoe UI Variable Small Semibol", 12F, System.Drawing.FontStyle.Bold);
+            this.SwSavePositionForm.Location = new System.Drawing.Point(174, 92);
+            this.SwSavePositionForm.Name = "SwSavePositionForm";
+            this.SwSavePositionForm.Size = new System.Drawing.Size(43, 15);
+            this.SwSavePositionForm.TabIndex = 1;
+            this.SwSavePositionForm.TextOnChecked = "";
             // 
             // FormMain
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 21F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(246)))), ((int)(((byte)(255)))), ((int)(((byte)(248)))));
+            this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(253)))), ((int)(((byte)(255)))), ((int)(((byte)(252)))));
             this.ClientSize = new System.Drawing.Size(731, 392);
             this.Controls.Add(this.TbPage);
             this.Controls.Add(this.statusStrip1);
@@ -622,6 +638,7 @@
         private System.Windows.Forms.ToolStripButton BtnUsers;
         private System.Windows.Forms.ToolStripButton BtnHistory;
         private EgoldsGoogleTextBox TbxName;
+        private EgoldsToggleSwitch SwSavePositionForm;
     }
 }
 

+ 1 - 1
ImpulseVision/FormMain.resx

@@ -182,7 +182,7 @@
     <value>627, 17</value>
   </metadata>
   <metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>57</value>
+    <value>83</value>
   </metadata>
   <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>

+ 24 - 0
ImpulseVision/ImpulseVision.csproj

@@ -76,6 +76,12 @@
   <ItemGroup>
     <Compile Include="Animation.cs" />
     <Compile Include="Animator.cs" />
+    <Compile Include="Card.cs">
+      <SubType>Component</SubType>
+    </Compile>
+    <Compile Include="Card.Designer.cs">
+      <DependentUpon>Card.cs</DependentUpon>
+    </Compile>
     <Compile Include="Drawer.cs" />
     <Compile Include="FDButton.cs">
       <SubType>Component</SubType>
@@ -120,7 +126,25 @@
     <Compile Include="RoudingButtonsComponent.cs">
       <SubType>Component</SubType>
     </Compile>
+    <Compile Include="RoudingPanel.cs">
+      <SubType>Component</SubType>
+    </Compile>
+    <Compile Include="RoudingPanel.Designer.cs">
+      <DependentUpon>RoudingPanel.cs</DependentUpon>
+    </Compile>
+    <Compile Include="RPanel.cs">
+      <SubType>Component</SubType>
+    </Compile>
+    <Compile Include="RPanelComponent.cs">
+      <SubType>Component</SubType>
+    </Compile>
     <Compile Include="StylesForForm.cs" />
+    <Compile Include="Switch.cs">
+      <SubType>Component</SubType>
+    </Compile>
+    <Compile Include="Switch.Designer.cs">
+      <DependentUpon>Switch.cs</DependentUpon>
+    </Compile>
     <Compile Include="yt_Button.cs">
       <SubType>Component</SubType>
     </Compile>

+ 419 - 0
ImpulseVision/RPanel.cs

@@ -0,0 +1,419 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Drawing.Drawing2D;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using static System.Windows.Forms.VisualStyles.VisualStyleElement.TextBox;
+using System.Windows.Forms;
+using ZedGraph;
+
+namespace ImpulseVision
+{
+    public class RPanel : Panel
+    {
+        #region -- Свойства --
+
+        [Description("Цвет обводки (границы) кнопки")]
+        public Color BorderColor { get; set; } = Color.Tomato;
+
+        [Description("Указывает, включено ли использование отдельного цвета обводки (границы) кнопки")]
+        public bool BorderColorEnabled { get; set; } = false;
+
+        [Description("Цвет обводки (границы) кнопки при наведении курсора")]
+        public Color BorderColorOnHover { get; set; } = Color.Tomato;
+
+        [Description("Указывает, включено ли использование отдельного цвета обводки (границы) кнопки при наведении курсора")]
+        public bool BorderColorOnHoverEnabled { get; set; } = false;
+
+        [Description("Дополнительный фоновый цвет кнопки используемый для создания градиента (При BackColorGradientEnabled = true)")]
+        public Color BackColorAdditional { get; set; } = Color.Gray;
+
+        [Description("Указывает, включен ли градинт кнопки")]
+        public bool BackColorGradientEnabled { get; set; } = false;
+
+        [Description("Определяет направление линейного градиента шапки")]
+        public LinearGradientMode BackColorGradientMode { get; set; } = LinearGradientMode.Horizontal;
+
+        [Description("Текст, отображаемый при наведении курсора")]
+        public string TextHover { get; set; }
+
+        private bool roundingEnable = false;
+        [Description("Вкл/Выкл закругление объекта")]
+        public bool RoundingEnable
+        {
+            get => roundingEnable;
+            set
+            {
+                roundingEnable = value;
+                Refresh();
+            }
+        }
+
+        private int roundingPercent = 100;
+        [DisplayName("Rounding [%]")]
+        [DefaultValue(100)]
+        [Description("Указывает радиус закругления объекта в процентном соотношении")]
+        public int Rounding
+        {
+            get => roundingPercent;
+            set
+            {
+                if (value >= 0 && value <= 100)
+                {
+                    roundingPercent = value;
+
+                    Refresh();
+                }
+            }
+        }
+
+        [Description("Вкл/Выкл эффект волны по нажатию кнопки курсором.")]
+        public bool UseRippleEffect { get; set; } = true;
+
+        [Description("Цвет эффекта волны по нажатию кнопки курсором")]
+        public Color RippleColor { get; set; } = Color.Black;
+
+        [Description("Вкл/Выкл эффект нажатия кнопки.")]
+        public bool UseDownPressEffectOnClick { get; set; }
+
+        public bool UseZoomEffectOnHover { get; set; }
+
+        public override string Text
+        {
+            get { return base.Text; }
+            set
+            {
+                base.Text = value;
+                Invalidate();
+            }
+        }
+
+        #endregion
+
+        #region -- Переменные --
+
+        private StringFormat SF = new StringFormat();
+
+        private bool MouseEntered = false;
+        private bool MousePressed = false;
+
+        Animation CurtainButtonAnim = new Animation();
+        //Animation RippleButtonAnim = new Animation();
+        Animation TextSlideAnim = new Animation();
+
+        Dictionary<Animation, Rectangle> RippleButtonAnimDic = new Dictionary<Animation, Rectangle>();
+
+        Point ClickLocation = new Point();
+
+        #endregion
+
+        public RPanel()
+        {
+            SetStyle(
+                ControlStyles.AllPaintingInWmPaint |
+                ControlStyles.OptimizedDoubleBuffer |
+                ControlStyles.ResizeRedraw |
+                ControlStyles.SupportsTransparentBackColor |
+                ControlStyles.UserPaint |
+                ControlStyles.Opaque |
+                ControlStyles.Selectable |
+                ControlStyles.UserMouse |
+                ControlStyles.EnableNotifyMessage,
+                true);
+            DoubleBuffered = true;
+
+            Size = new Size(100, 30);
+
+            Font = new Font("Verdana", 8.25F, FontStyle.Regular);
+
+            Cursor = Cursors.Hand;
+
+            BackColor = Color.Tomato;
+            BorderColor = BackColor;
+            ForeColor = Color.White;
+
+            SF.Alignment = StringAlignment.Center;
+            SF.LineAlignment = StringAlignment.Center;
+        }
+
+        protected override void OnPaint(PaintEventArgs e)
+        {
+            base.OnPaint(e);
+
+            Graphics graph = e.Graphics;
+            graph.SmoothingMode = SmoothingMode.HighQuality;
+            graph.InterpolationMode = InterpolationMode.HighQualityBicubic;
+            graph.PixelOffsetMode = PixelOffsetMode.HighQuality;
+            graph.SmoothingMode = SmoothingMode.AntiAlias;
+
+            graph.Clear(Parent.BackColor);
+
+            Rectangle rect = new Rectangle(0, 0, Width - 1, Height - 1);
+            Rectangle rectCurtain = new Rectangle(0, 0, (int)CurtainButtonAnim.Value, Height - 1);
+
+            Rectangle rectText = new Rectangle((int)TextSlideAnim.Value, rect.Y, rect.Width, rect.Height);
+            Rectangle rectTextHover = new Rectangle((int)TextSlideAnim.Value - rect.Width, rect.Y, rect.Width, rect.Height);
+
+            // Закругление
+            float roundingValue = 0.1F;
+            if (RoundingEnable && roundingPercent > 0)
+            {
+                roundingValue = Height / 100F * roundingPercent;
+            }
+            GraphicsPath rectPath = Drawer.RoundedRectangle(rect, roundingValue);
+
+            Region = new Region(rectPath);
+            graph.Clear(Parent.BackColor);
+
+
+            Brush headerBrush = new SolidBrush(BackColor);
+            if (BackColorGradientEnabled)
+            {
+                if (rect.Width > 0 && rect.Height > 0)
+                    headerBrush = new LinearGradientBrush(rect, BackColor, BackColorAdditional, BackColorGradientMode);
+            }
+
+            Brush borderBrush = headerBrush;
+            if (BorderColorEnabled)
+            {
+                borderBrush = new SolidBrush(BorderColor);
+
+                if (MouseEntered && BorderColorOnHoverEnabled)
+                    borderBrush = new SolidBrush(BorderColorOnHover);
+            }
+
+            // Основной прямоугольник (Фон)
+            graph.DrawPath(new Pen(borderBrush), rectPath);
+            graph.FillPath(headerBrush, rectPath);
+
+            graph.SetClip(rectPath);
+
+            // Рисуем доп. прямоугольник (Наша шторка)
+            graph.DrawRectangle(new Pen(Color.FromArgb(60, Color.White)), rectCurtain);
+            graph.FillRectangle(new SolidBrush(Color.FromArgb(60, Color.White)), rectCurtain);
+
+
+            //if (UseRippleEffect == false)
+            //{
+            //    // Стандартное рисование праямоугольника при клике
+            //    if (MousePressed)
+            //    {
+            //        graph.DrawRectangle(new Pen(Color.FromArgb(30, Color.Black)), rect);
+            //        graph.FillRectangle(new SolidBrush(Color.FromArgb(30, Color.Black)), rect);
+            //    }
+            //}
+            //else
+            //{
+            //    // Ripple Effect - Волна
+            //    for (int i = 0; i < RippleButtonAnimDic.Count; i++)
+            //    {
+            //        KeyValuePair<Animation, Rectangle> animRect = RippleButtonAnimDic.ToList()[i];
+            //        Animation MultiRippleButtonAnim = animRect.Key;
+            //        Rectangle rectMultiRipple = animRect.Value;
+
+            //        rectMultiRipple = new Rectangle(
+            //           ClickLocation.X - (int)MultiRippleButtonAnim.Value / 2,
+            //           ClickLocation.Y - (int)MultiRippleButtonAnim.Value / 2,
+            //           (int)MultiRippleButtonAnim.Value,
+            //           (int)MultiRippleButtonAnim.Value
+            //           );
+
+            //        if (MultiRippleButtonAnim.Value > 0 && MultiRippleButtonAnim.Value < MultiRippleButtonAnim.TargetValue)
+            //        {
+            //            graph.DrawEllipse(new Pen(Color.FromArgb(30, RippleColor)), rectMultiRipple);
+            //            graph.FillEllipse(new SolidBrush(Color.FromArgb(30, RippleColor)), rectMultiRipple);
+            //        }
+            //        else if (MultiRippleButtonAnim.Value == MultiRippleButtonAnim.TargetValue)
+            //        {
+            //            if (MousePressed == false)
+            //            {
+            //                MultiRippleButtonAnim.Value = 0;
+            //                MultiRippleButtonAnim.Status = Animation.AnimationStatus.Completed;
+            //            }
+            //            else
+            //            {
+            //                if (i == RippleButtonAnimDic.Count - 1)
+            //                {
+            //                    graph.DrawEllipse(new Pen(Color.FromArgb(30, RippleColor)), rectMultiRipple);
+            //                    graph.FillEllipse(new SolidBrush(Color.FromArgb(30, RippleColor)), rectMultiRipple);
+            //                }
+            //            }
+            //        }
+            //    }
+            //    // Удаляем из очереди выполненные анимации волны
+            //    List<Animation> completedRippleAnimations = RippleButtonAnimDic.Keys.ToList().FindAll(x => x.Status == Animation.AnimationStatus.Completed);
+            //    for (int i = 0; i < completedRippleAnimations.Count; i++)
+            //        RippleButtonAnimDic.Remove(completedRippleAnimations[i]);
+        }
+
+        // Ripple Effect - Волна
+        //////if (RippleButtonAnim.Value > 0 && RippleButtonAnim.Value < RippleButtonAnim.TargetValue)
+        //////{
+        //////    graph.DrawEllipse(new Pen(Color.FromArgb(30, Color.Black)), rectRipple);
+        //////    graph.FillEllipse(new SolidBrush(Color.FromArgb(30, Color.Black)), rectRipple);
+        //////}
+        //////else if (RippleButtonAnim.Value == RippleButtonAnim.TargetValue)
+        //////{
+        //////    // Тут можно добавить проверку MousePressed, если false тогда обнуляем
+        //////    if (MousePressed == false)
+        //////    {
+        //////        RippleButtonAnim.Value = 0;
+        //////    }
+        //////    else
+        //////    {
+        //////        graph.DrawEllipse(new Pen(Color.FromArgb(30, Color.Black)), rectRipple);
+        //////        graph.FillEllipse(new SolidBrush(Color.FromArgb(30, Color.Black)), rectRipple);
+        //////    }
+        //////}
+
+
+        // Рисуем текст
+        //if (string.IsNullOrEmpty(TextHover))
+        //{
+        //    graph.DrawString(Text, Font, new SolidBrush(ForeColor), rect, SF);
+        //}
+        //else
+        //{
+        //    graph.DrawString(Text, Font, new SolidBrush(ForeColor), rectText, SF);
+        //    graph.DrawString(TextHover, Font, new SolidBrush(ForeColor), rectTextHover, SF);
+        //}
+    }
+    /*
+        private void TextSlideAction()
+        {
+            if (MouseEntered)
+            {
+                TextSlideAnim = new Animation("TextSlide_" + Handle, Invalidate, TextSlideAnim.Value, Width - 1);
+            }
+            else
+            {
+                TextSlideAnim = new Animation("TextSlide_" + Handle, Invalidate, TextSlideAnim.Value, 0);
+            }
+
+            TextSlideAnim.StepDivider = 8;
+            Animator.Request(TextSlideAnim, true);
+        }
+
+        //private void ButtonRippleAction()
+        //{
+        //    RippleButtonAnim = new Animation("ButtonRipple_" + Handle, Invalidate, 0, Width * 2);
+
+        //    RippleButtonAnim.StepDivider = 14;
+        //    Animator.Request(RippleButtonAnim, true);
+        //}
+    */
+    /*
+        private void ButtonMultiRippleAction()
+        {
+            Animation MultiRippleButtonAnim = new Animation("ButtonMultiRipple_" + Handle + DateTime.Now.Millisecond, Invalidate, 0, Width * 3);
+            MultiRippleButtonAnim.StepDivider = 20;
+
+            Animator.Request(MultiRippleButtonAnim);
+
+            RippleButtonAnimDic.Add(MultiRippleButtonAnim, new Rectangle());
+        }
+    */
+    /*
+        private void ButtonCurtainAction()
+        {
+            if (MouseEntered)
+            {
+                CurtainButtonAnim = new Animation("ButtonCurtain_" + Handle, Invalidate, CurtainButtonAnim.Value, Width - 1);
+            }
+            else
+            {
+                CurtainButtonAnim = new Animation("ButtonCurtain_" + Handle, Invalidate, CurtainButtonAnim.Value, 0);
+            }
+
+            CurtainButtonAnim.StepDivider = 8;
+            Animator.Request(CurtainButtonAnim, true);
+        }
+    */
+    /*
+        protected override void OnMouseEnter(EventArgs e)
+        {
+            base.OnMouseEnter(e);
+
+            MouseEntered = true;
+
+            if (UseZoomEffectOnHover)
+            {
+                Rectangle buttonRect = new Rectangle(Location, Size);
+                buttonRect.Inflate(1, 1);
+                Location = buttonRect.Location;
+                Size = buttonRect.Size;
+            }
+
+            ButtonCurtainAction();
+            TextSlideAction();
+        }
+    */
+    /*
+        protected override void OnMouseLeave(EventArgs e)
+        {
+            base.OnMouseLeave(e);
+
+            MouseEntered = false;
+
+            if (UseZoomEffectOnHover)
+            {
+                Rectangle buttonRect = new Rectangle(Location, Size);
+                buttonRect.Inflate(-1, -1);
+                Location = buttonRect.Location;
+                Size = buttonRect.Size;
+            }
+
+            ButtonCurtainAction();
+            TextSlideAction();
+
+        }
+    */
+    /*
+        protected override void OnMouseDown(MouseEventArgs e)
+        {
+            base.OnMouseDown(e);
+
+            MousePressed = true;
+
+            CurtainButtonAnim.Value = CurtainButtonAnim.TargetValue;
+
+            ClickLocation = e.Location;
+            //ButtonRippleAction();
+            ButtonMultiRippleAction();
+
+            if (UseDownPressEffectOnClick) Location = new Point(Location.X, Location.Y + 2);
+
+            Focus();
+        }
+    */
+    /*
+        protected override void OnMouseUp(MouseEventArgs e)
+        {
+            base.OnMouseUp(e);
+
+            MousePressed = false;
+
+            Invalidate();
+
+            if (UseDownPressEffectOnClick) Location = new Point(Location.X, Location.Y - 2);
+        }
+    */
+    /*
+        protected override void OnTextChanged(EventArgs e)
+        {
+            base.OnTextChanged(e);
+
+            //Invalidate();
+        }
+    */
+    /*
+        protected override void OnParentBackColorChanged(EventArgs e)
+        {
+            Invalidate();
+            base.OnParentBackColorChanged(e);
+        }
+    */
+}

+ 42 - 0
ImpulseVision/RPanelComponent.cs

@@ -0,0 +1,42 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ImpulseVision
+{
+    partial class RPanelComponent
+    {
+        /// <summary>
+        /// Обязательная переменная конструктора.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary> 
+        /// Освободить все используемые ресурсы.
+        /// </summary>
+        /// <param name="disposing">истинно, если управляемый ресурс должен быть удален; иначе ложно.</param>
+        //protected override void Dispose(bool disposing)
+        //{
+        //    if (disposing && (components != null))
+        //    {
+        //        components.Dispose();
+        //    }
+        //    base.Dispose(disposing);
+        //}
+
+        #region Код, автоматически созданный конструктором компонентов
+
+        /// <summary>
+        /// Требуемый метод для поддержки конструктора — не изменяйте 
+        /// содержимое этого метода с помощью редактора кода.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            components = new System.ComponentModel.Container();
+        }
+
+        #endregion
+    }
+}

+ 36 - 0
ImpulseVision/RoudingPanel.Designer.cs

@@ -0,0 +1,36 @@
+namespace ImpulseVision
+{
+    partial class RPanelComponent1
+    {
+        /// <summary> 
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary> 
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        //protected override void Dispose(bool disposing)
+        //{
+        //    if (disposing && (components != null))
+        //    {
+        //        components.Dispose();
+        //    }
+        //    base.Dispose(disposing);
+        //}
+
+        #region Component Designer generated code
+
+        /// <summary> 
+        /// Required method for Designer support - do not modify 
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            components = new System.ComponentModel.Container();
+        }
+
+        #endregion
+    }
+}

+ 98 - 0
ImpulseVision/RoudingPanel.cs

@@ -0,0 +1,98 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace ImpulseVision
+{
+    public partial class RPanelComponent : Component
+    {
+        public Form TargetForm { get; set; }
+
+        private bool roundingEnable = false;
+        [Description("Вкл/Выкл закругление объекта")]
+        public bool RoundingEnable
+        {
+            get => roundingEnable;
+            set
+            {
+                roundingEnable = value;
+                Update();
+            }
+        }
+
+        private int roundingPercent = 100;
+        [DisplayName("Rounding [%]")]
+        [DefaultValue(100)]
+        [Description("Указывает радиус закругления объекта в процентном соотношении")]
+        public int Rounding
+        {
+            get => roundingPercent;
+            set
+            {
+                if (value >= 0 && value <= 100)
+                {
+                    roundingPercent = value;
+
+                    Update();
+                }
+            }
+        }
+
+        [DefaultValue(true)]
+        [Description("Применять закругление для вложенных контейнеров")]
+        public bool NestedContainers { get; set; } = true;
+
+        public RPanelComponent()
+        {
+            InitializeComponent();
+        }
+
+        public RPanelComponent(IContainer container)
+        {
+            Update();
+
+            container.Add(this);
+
+            InitializeComponent();
+        }
+
+        public void Update()
+        {
+            if (TargetForm != null && TargetForm.Controls.Count > 0)
+            {
+                DefineRounding(TargetForm.Controls);
+            }
+        }
+
+        public void DefineRounding(Control.ControlCollection controls)
+        {
+            foreach (Control ctrl in controls)
+            {
+                if (ctrl is yt_Button)
+                {
+                    yt_Button btn = (yt_Button)ctrl;
+
+                    btn.RoundingEnable = RoundingEnable;
+                    btn.Rounding = Rounding;
+
+                    btn.Refresh();
+                }
+
+                if (NestedContainers)
+                {
+                    if (ctrl.Controls.Count > 0)
+                    {
+                        DefineRounding(ctrl.Controls);
+                    }
+                }
+            }
+        }
+    }
+
+}

+ 37 - 0
ImpulseVision/Switch.Designer.cs

@@ -0,0 +1,37 @@
+namespace ImpulseVision
+{
+    partial class Switch
+    {
+        /// <summary> 
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary> 
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        //public override void Dispose(bool disposing)
+        //{
+        //    if (disposing && (components != null))
+        //    {
+        //        components.Dispose();
+        //    }
+        //    base.Dispose(disposing);
+        //}
+
+        #region Component Designer generated code
+
+        /// <summary> 
+        /// Required method for Designer support - do not modify 
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            components = new System.ComponentModel.Container();
+            //this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+        }
+
+        #endregion
+    }
+}

+ 220 - 0
ImpulseVision/Switch.cs

@@ -0,0 +1,220 @@
+using ImpulseVision;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Drawing.Drawing2D;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+using static System.Net.Mime.MediaTypeNames;
+using static System.Windows.Forms.VisualStyles.VisualStyleElement.TextBox;
+using System.Windows.Forms.Design;
+
+namespace ImpulseVision
+{
+    [Designer(typeof(ControlDesignerEx))] // ControlDesignerEx Добавляем для ограничения изменения размеров
+    [DefaultEvent("CheckedChanged")]
+    public class EgoldsToggleSwitch : Control
+    {
+        #region -- Свойства --
+
+        public bool Checked
+        {
+            get => _checked;
+            set
+            {
+                _checked = value;
+
+                SwitchToggle();
+
+                UpdateSize();
+                UpdateStructures();
+            }
+        }
+        private bool _checked = false;
+
+        public Color BackColorON { get; set; } = FlatColors.GreenDark;
+        public Color BackColorOFF { get; set; } = FlatColors.Red;
+
+        public override string Text
+        {
+            get => text;
+            set
+            {
+                text = value;
+                UpdateSize();
+                UpdateStructures();
+            }
+        }
+        private string text = string.Empty;
+
+        public string TextOnChecked
+        {
+            get => _textOnChecked;
+            set
+            {
+                _textOnChecked = value;
+                UpdateSize();
+                UpdateStructures();
+            }
+        }
+        private string _textOnChecked = string.Empty;
+
+        #endregion
+
+        #region -- Переменные --
+
+        private Rectangle rectToggleHolder;
+        private int ToogleSwitchWidth = 40;
+
+        private Rectangle rectText;
+
+        private int TogglePosX_ON;
+        private int TogglePosX_OFF;
+
+        private Animation ToggleAnim = new Animation();
+
+        private StringFormat SF = new StringFormat();
+
+        #endregion
+
+        #region -- События --
+
+        [Description("Возникает при каждом изменении свойства Checked")]
+        public event OnCheckedChangedHandler CheckedChanged;
+        public delegate void OnCheckedChangedHandler(object sender);
+
+        #endregion
+
+        public EgoldsToggleSwitch()
+        {
+            SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw | ControlStyles.SupportsTransparentBackColor | ControlStyles.UserPaint, true);
+            DoubleBuffered = true;
+
+            SF.Alignment = StringAlignment.Near;
+            SF.LineAlignment = StringAlignment.Center;
+
+            Font = new Font("Verdana", 9F, FontStyle.Regular);
+            BackColor = Color.White;
+
+            Cursor = Cursors.Hand;
+
+            Size = new Size(ToogleSwitchWidth, 15);
+            UpdateSize();
+            UpdateStructures();
+        }
+
+        protected override void OnCreateControl()
+        {
+            base.OnCreateControl();
+
+            UpdateStructures();
+
+            ToggleAnim.Value = Checked == true ? TogglePosX_ON : TogglePosX_OFF;
+        }
+
+        protected override void OnPaint(PaintEventArgs e)
+        {
+            base.OnPaint(e);
+
+            Graphics graph = e.Graphics;
+            graph.SmoothingMode = SmoothingMode.HighQuality;
+            graph.Clear(Parent.BackColor);
+
+            Pen penToggleHolder = new Pen(FlatColors.GrayDark, 1.55f);
+            Pen penToggle = new Pen(FlatColors.GrayDark, 3);
+
+            GraphicsPath gpathToggle = Drawer.RoundedRectangle(rectToggleHolder, rectToggleHolder.Height);
+            Rectangle rectToggle = new Rectangle((int)ToggleAnim.Value, rectToggleHolder.Y, rectToggleHolder.Height, rectToggleHolder.Height);
+
+            graph.DrawPath(penToggleHolder, gpathToggle);
+
+            if (Checked == true)
+            {
+                if (Animator.IsWork == false)
+                    rectToggle.Location = new Point(TogglePosX_ON, rectToggleHolder.Y);
+
+                graph.FillPath(new SolidBrush(BackColorON), gpathToggle);
+            }
+            else
+            {
+                if (Animator.IsWork == false)
+                    rectToggle.Location = new Point(TogglePosX_OFF, rectToggleHolder.Y);
+
+                graph.FillPath(new SolidBrush(BackColorOFF), gpathToggle);
+            }
+
+            graph.DrawEllipse(penToggle, rectToggle);
+            graph.FillEllipse(new SolidBrush(BackColor), rectToggle);
+
+            string drawText = Text;
+            if (!string.IsNullOrEmpty(TextOnChecked) && Checked)
+                drawText = TextOnChecked;
+
+            graph.DrawString(drawText, Font, new SolidBrush(ForeColor), rectText, SF);
+        }
+
+        protected override void OnMouseDown(MouseEventArgs e)
+        {
+            base.OnMouseDown(e);
+
+            Checked = !Checked;
+        }
+
+        private void SwitchToggle()
+        {
+            if (Checked == true)
+            {
+                ToggleAnim = new Animation("Toggle_" + Handle, Invalidate, ToggleAnim.Value, TogglePosX_ON);
+            }
+            else
+            {
+                ToggleAnim = new Animation("Toggle_" + Handle, Invalidate, ToggleAnim.Value, TogglePosX_OFF);
+            }
+
+            ToggleAnim.StepDivider = 8;
+            Animator.Request(ToggleAnim, true);
+
+            CheckedChanged?.Invoke(this);
+        }
+
+        private void UpdateSize()
+        {
+            string drawText = Text;
+            if (!string.IsNullOrEmpty(TextOnChecked) && Checked) drawText = TextOnChecked;
+
+            Size size = TextRenderer.MeasureText(drawText, Font);
+            Width = ToogleSwitchWidth + size.Width + 3;
+        }
+
+        private void UpdateStructures()
+        {
+            rectToggleHolder = new Rectangle(1, 1, ToogleSwitchWidth - 3, Height - 3);
+
+            int rectTextWidth = Width - ToogleSwitchWidth - 3;
+            int rectTextX = rectToggleHolder.Right + 6;
+            rectText = new Rectangle(rectTextX, rectToggleHolder.Y, rectTextWidth, rectToggleHolder.Height);
+
+            TogglePosX_OFF = rectToggleHolder.X;
+            TogglePosX_ON = rectToggleHolder.Right - rectToggleHolder.Height;
+        }
+
+        /// <summary>
+        /// В этом классе переопределяем SelectionRules, и даем возможность только изменять ширину и перемещать объект
+        /// </summary>
+        class ControlDesignerEx : ControlDesigner
+        {
+            public override SelectionRules SelectionRules
+            {
+                get
+                {
+                    SelectionRules sr = SelectionRules.Moveable | SelectionRules.Visible;
+                    return sr;
+                }
+            }
+        }
+    }
+}

BIN
ImpulseVision/bin/Debug/ImpulseVision.exe