Parcourir la source

Градиент на фоне формы авторизации

Вячеслав Терешенко il y a 2 ans
Parent
commit
e83fd853c6

+ 76 - 74
ImpulseVision/FormAutorize.Designer.cs

@@ -29,14 +29,83 @@
         private void InitializeComponent()
         {
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormAutorize));
+            this.PanelAutorize = new ImpulseVision.RPanel();
+            this.Card = new ImpulseVision.FDCard();
+            this.TbxLogin = new ImpulseVision.EgoldsGoogleTextBox();
             this.BtnLogin = new System.Windows.Forms.Button();
             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();
             // 
+            // 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;
+            // 
+            // Card
+            // 
+            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 = "Здесь могла быть ваша реклама";
+            this.Card.TextHeader = "Авторизация";
+            // 
+            // 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)(171)))), ((int)(((byte)(188)))), ((int)(((byte)(193)))));
+            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)(24)))), ((int)(((byte)(62)))), ((int)(((byte)(71)))));
+            this.TbxLogin.Cursor = System.Windows.Forms.Cursors.IBeam;
+            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(291, 59);
+            this.TbxLogin.Name = "TbxLogin";
+            this.TbxLogin.SelectionStart = 0;
+            this.TbxLogin.Size = new System.Drawing.Size(210, 40);
+            this.TbxLogin.TabIndex = 1;
+            this.TbxLogin.TextInput = "";
+            this.TbxLogin.TextPreview = "Логин";
+            this.TbxLogin.UseSystemPasswordChar = false;
+            // 
             // BtnLogin
             // 
             this.BtnLogin.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(124)))), ((int)(((byte)(136)))), ((int)(((byte)(144)))));
@@ -54,9 +123,9 @@
             // TbxPassword
             // 
             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.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(171)))), ((int)(((byte)(188)))), ((int)(((byte)(193)))));
             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.BorderColorNotActive = System.Drawing.Color.FromArgb(((int)(((byte)(24)))), ((int)(((byte)(62)))), ((int)(((byte)(71)))));
             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);
@@ -70,75 +139,6 @@
             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)))));
-            this.TbxLogin.Cursor = System.Windows.Forms.Cursors.IBeam;
-            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(291, 59);
-            this.TbxLogin.Name = "TbxLogin";
-            this.TbxLogin.SelectionStart = 0;
-            this.TbxLogin.Size = new System.Drawing.Size(210, 40);
-            this.TbxLogin.TabIndex = 1;
-            this.TbxLogin.TextInput = "";
-            this.TbxLogin.TextPreview = "Логин";
-            this.TbxLogin.UseSystemPasswordChar = false;
-            // 
-            // Card
-            // 
-            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);
@@ -154,6 +154,8 @@
             this.Text = "ImpulseVision";
             this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FormAutorize_FormClosing);
             this.Load += new System.EventHandler(this.FormAutorize_Load);
+            this.Paint += new System.Windows.Forms.PaintEventHandler(this.FormAutorize_Paint);
+            this.Resize += new System.EventHandler(this.FormAutorize_Resize);
             this.PanelAutorize.ResumeLayout(false);
             this.ResumeLayout(false);
 

+ 24 - 0
ImpulseVision/FormAutorize.cs

@@ -3,10 +3,12 @@ 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 System.Windows.Forms.Design;
 
 namespace ImpulseVision
 {
@@ -35,5 +37,27 @@ namespace ImpulseVision
             FStart.ShowDialog();
 
         }
+        /// <summary>
+        /// рисование градиентной заливки на форме
+        /// </summary>
+        private void FormAutorize_Paint(object sender, PaintEventArgs e)
+        {
+            Point PtStart = new Point(0, 0);
+            Point PtEnd = new Point(Width, Height);
+            Color ColFirst = ColorTranslator.FromHtml("#0F2834");
+            Color ColThird = ColorTranslator.FromHtml("#496870");
+            LinearGradientBrush LGB = new LinearGradientBrush(PtStart, PtEnd, ColFirst, ColThird);
+
+            Pen MyPen = new Pen(LGB);
+
+            Rectangle Rect = new Rectangle(PtStart,new Size(PtEnd));
+            //e.Graphics.DrawRectangle(MyPen, 0, 0, Width, Height);
+            e.Graphics.FillRectangle(LGB, Rect);
+        }
+
+        private void FormAutorize_Resize(object sender, EventArgs e)
+        {
+            Invalidate();
+        }
     }
 }

BIN
ImpulseVision/bin/Debug/ImpulseVision.exe