THE_LORD

GreenUI Theme

Dec 17th, 2016
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 57.04 KB | None | 0 0
  1.  
  2.     /// <summary>
  3.     /// GreenUI Theme
  4.     /// Author : THE LORD
  5.     /// Release Date : Saturday, December 17, 2016
  6.     /// Last Update : Monday, January 9, 2017
  7.     /// Update Purpose : Bugs Fixed, ComboBox & TabControl Added.
  8.     /// </summary>
  9.  
  10.     #region Namespaces
  11.  
  12. using System;
  13. using System.Collections.Generic;
  14. using System.ComponentModel;
  15. using System.Diagnostics;
  16. using System.Drawing;
  17. using System.Drawing.Drawing2D;
  18. using System.Linq;
  19. using System.Runtime.CompilerServices;
  20. using System.Text;
  21. using System.Threading.Tasks;
  22. using System.Windows.Forms;
  23.  
  24. #endregion
  25.  
  26.     #region Helper Methods
  27.  
  28. public class HelperMethods
  29. {
  30.  
  31.     public GraphicsPath GP = null;
  32.  
  33.     public enum MouseMode
  34.     {
  35.         NormalMode,
  36.         Hovered,
  37.         Pushed
  38.     };
  39.  
  40.     public void DrawImageFromBase64(Graphics G, string Base64Image, Rectangle Rect)
  41.     {
  42.         Image IM = null;
  43.         using (System.IO.MemoryStream ms = new System.IO.MemoryStream(Convert.FromBase64String(Base64Image)))
  44.         {
  45.             IM = System.Drawing.Image.FromStream(ms);
  46.         }
  47.         G.DrawImage(IM, Rect);
  48.     }
  49.  
  50.     public GraphicsPath RoundRec(Rectangle r, int Curve, bool TopLeft = true, bool TopRight = true, bool BottomLeft = true, bool BottomRight = true)
  51.     {
  52.         GraphicsPath CreateRoundPath = new GraphicsPath(FillMode.Winding);
  53.         if (TopLeft)
  54.         {
  55.             CreateRoundPath.AddArc(r.X, r.Y, Curve, Curve, 180f, 90f);
  56.         }
  57.         else
  58.         {
  59.             CreateRoundPath.AddLine(r.X, r.Y, r.X, r.Y);
  60.         }
  61.         if (TopRight)
  62.         {
  63.             CreateRoundPath.AddArc(r.Right - Curve, r.Y, Curve, Curve, 270f, 90f);
  64.         }
  65.         else
  66.         {
  67.             CreateRoundPath.AddLine(r.Right - r.Width, r.Y, r.Width, r.Y);
  68.         }
  69.         if (BottomRight)
  70.         {
  71.             CreateRoundPath.AddArc(r.Right - Curve, r.Bottom - Curve, Curve, Curve, 0f, 90f);
  72.         }
  73.         else
  74.         {
  75.             CreateRoundPath.AddLine(r.Right, r.Bottom, r.Right, r.Bottom);
  76.  
  77.         }
  78.         if (BottomLeft)
  79.         {
  80.             CreateRoundPath.AddArc(r.X, r.Bottom - Curve, Curve, Curve, 90f, 90f);
  81.         }
  82.         else
  83.         {
  84.             CreateRoundPath.AddLine(r.X, r.Bottom, r.X, r.Bottom);
  85.         }
  86.         CreateRoundPath.CloseFigure();
  87.         return CreateRoundPath;
  88.     }
  89.  
  90.         public LinearGradientBrush ShadowBrush(Rectangle R ,Color C , int Intesity, int angle )
  91.         {
  92.         return new LinearGradientBrush(R, Color.FromArgb(Intesity, C), Color.Transparent, angle);
  93.         }
  94.  
  95.     public void FillRoundedPath(Graphics G, Color C, Rectangle Rect, int Curve, bool TopLeft = true, bool TopRight = true, bool BottomLeft = true, bool BottomRight = true)
  96.     {
  97.         G.FillPath(new SolidBrush(C), RoundRec(Rect, Curve,TopLeft,TopRight,BottomLeft,BottomRight));
  98.     }
  99.  
  100.     public void FillRoundedPath(Graphics G, Brush B, Rectangle Rect, int Curve, bool TopLeft = true, bool TopRight = true, bool BottomLeft = true, bool BottomRight = true)
  101.     {
  102.         G.FillPath(B, RoundRec(Rect, Curve, TopLeft, TopRight, BottomLeft, BottomRight));
  103.     }
  104.  
  105.     public void DrawRoundedPath(Graphics G, Color C, Single Size, Rectangle Rect, int Curve, bool TopLeft = true, bool TopRight = true, bool BottomLeft = true, bool BottomRight = true)
  106.     {
  107.         G.DrawPath(new Pen(C, Size), RoundRec(Rect, Curve, TopLeft, TopRight, BottomLeft, BottomRight));
  108.  
  109.     }
  110.  
  111.     public void DrawTriangle(Graphics G, Color C, Single Size, Point P1_0, Point P1_1, Point P2_0, Point P2_1, Point P3_0, Point P3_1)
  112.     {
  113.  
  114.         G.DrawLine(new Pen(C, Size), P1_0, P1_1);
  115.         G.DrawLine(new Pen(C, Size), P2_0, P2_1);
  116.         G.DrawLine(new Pen(C, Size), P3_0, P3_1);
  117.  
  118.     }
  119.  
  120.     public Pen PenRGBColor(int R, int G, int B, Single size)
  121.     { return new Pen(System.Drawing.Color.FromArgb(R, G, B), size); }
  122.  
  123.     public Pen PenHTMlColor(String C_WithoutHash, float Thick)
  124.     { return new Pen(GetHTMLColor(C_WithoutHash), Thick); }
  125.  
  126.     public SolidBrush SolidBrushRGBColor(int R, int G, int B, int A = 0)
  127.     { return new SolidBrush(System.Drawing.Color.FromArgb(A, R, G, B)); }
  128.  
  129.     public SolidBrush SolidBrushHTMlColor(String C_WithoutHash)
  130.     { return new SolidBrush(GetHTMLColor(C_WithoutHash)); }
  131.  
  132.     public Color GetHTMLColor(String C_WithoutHash)
  133.     { return ColorTranslator.FromHtml("#" + C_WithoutHash); }
  134.  
  135.     public String ColorToHTML(Color C)
  136.     { return ColorTranslator.ToHtml(C); }
  137.  
  138.     public Color SetARGB(int A, int R, int G, int B)
  139.     { return System.Drawing.Color.FromArgb(A, R, G, B); }
  140.  
  141.     public Color SetRGB(int R, int G, int B)
  142.     { return System.Drawing.Color.FromArgb(R, G, B); }
  143.  
  144.     public void CentreString(Graphics G, String Text, Font font, Brush brush, Rectangle Rect)
  145.     { G.DrawString(Text, font, brush, new Rectangle(Rect.X, Rect.Y, Rect.Width, Rect.Height), new StringFormat() { Alignment = StringAlignment.Center, LineAlignment = StringAlignment.Center }); }
  146.  
  147.     public void LeftString(Graphics G, String Text, Font font, Brush brush, Rectangle Rect)
  148.     {
  149.         G.DrawString(Text, font, brush, new Rectangle(4, Rect.Y + Convert.ToInt32(Rect.Height / 2) - Convert.ToInt32(G.MeasureString(Text, font).Height / 2) + 0, Rect.Width, Rect.Height), new StringFormat { Alignment = StringAlignment.Near });
  150.     }
  151.  
  152.     public void RightString(Graphics G, string Text, Font font, Brush brush, Rectangle Rect)
  153.     {
  154.         G.DrawString(Text, font, brush, new Rectangle(4, Convert.ToInt32(Rect.Y + (Rect.Height / 2) - (G.MeasureString(Text, font).Height / 2)), Rect.Width - Rect.Height + 10, Rect.Height), new StringFormat { Alignment = StringAlignment.Far });
  155.     }
  156. }
  157.  
  158. #endregion
  159.  
  160.     #region Skin
  161.  
  162.     public class GreenUISkin : ContainerControl
  163.     {
  164.  
  165.         #region Variables  
  166.  
  167.         bool Movable  = false;
  168.         private TitlePostion _TitleTextPostion   = TitlePostion.Left;
  169.         static Point MousePoint= new Point(0, 0);
  170.         private int MoveHeight = 50;
  171.         private static HelperMethods H = new HelperMethods();
  172.         private bool _ShowIcon;
  173.  
  174. #endregion
  175.  
  176.         #region  Properties
  177.  
  178.         public bool ShowIcon
  179.         {
  180.             get { return _ShowIcon; }
  181.             set
  182.             {
  183.                 if (value == _ShowIcon) { return; }
  184.                 FindForm().ShowIcon = value;
  185.                 Invalidate();
  186.                 _ShowIcon = value;
  187.  
  188.             }
  189.         }
  190.  
  191.    
  192.             public TitlePostion TitleTextPostion
  193.         {
  194.             get { return _TitleTextPostion;}
  195.  
  196.             set
  197.             {
  198.                 _TitleTextPostion = value;
  199.                 Invalidate();
  200.             }
  201.  
  202.          }
  203.  
  204.  
  205.    public  enum TitlePostion{
  206.         Left,
  207.         Center
  208.         };
  209.  
  210.         #endregion
  211.        
  212.         #region  Initialization
  213.  
  214.     public GreenUISkin()
  215.     {
  216.         SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw | ControlStyles.SupportsTransparentBackColor,true);
  217.         DoubleBuffered = true;
  218.         UpdateStyles();
  219.         Font = new Font("Proxima Nova", 14, FontStyle.Bold);
  220.         BackColor = Color.Gainsboro;
  221.  
  222.     }
  223.  
  224. #endregion
  225.  
  226.         #region Mouse & other Events
  227.  
  228.     protected override void OnCreateControl()
  229.     {
  230.         base.OnCreateControl();
  231.         ParentForm.FormBorderStyle = FormBorderStyle.None;
  232.         ParentForm.TransparencyKey = Color.Fuchsia;
  233.         Dock = DockStyle.Fill;
  234.     }
  235.  
  236.  
  237.     protected override void OnMouseMove(MouseEventArgs e)
  238.     {
  239.         base.OnMouseMove(e);
  240.         int x = MousePosition.X;
  241.         int y = MousePosition.Y;
  242.         int x1 = MousePoint.X;
  243.         int y1 = MousePoint.Y;
  244.         if (Movable)
  245.  
  246.             Parent.Location = new Point(x - x1, y - y1);
  247.         Focus();
  248.     }
  249.  
  250.     protected override void OnMouseDown(MouseEventArgs e)
  251.     {
  252.         base.OnMouseDown(e);
  253.         if (e.Button == System.Windows.Forms.MouseButtons.Left && new Rectangle(0, 0, Width, MoveHeight).Contains(e.Location))
  254.         {
  255.             Movable = true;
  256.             MousePoint = e.Location;
  257.         }
  258.  
  259.     }
  260.  
  261.     protected override void OnMouseUp(MouseEventArgs e)
  262.     {
  263.         base.OnMouseUp(e);
  264.         Movable = false;
  265.     }
  266.  
  267.         #endregion
  268.  
  269.         #region Draw Control
  270.  
  271.     protected override void OnPaint(PaintEventArgs e)
  272.     {
  273.  
  274.         Rectangle Rect = new Rectangle(1, 1, (int)(Width - 2.5), (int)(Height - 2.5));
  275.         Bitmap B = new Bitmap(Width, Height);
  276.         using (Graphics G = Graphics.FromImage(B))
  277.         {
  278.             G.Clear(Color.Fuchsia);
  279.  
  280.             G.TextRenderingHint = System.Drawing.Text.TextRenderingHint.ClearTypeGridFit;
  281.  
  282.              H.FillRoundedPath(G, Color.Gainsboro, Rect, 8);
  283.  
  284.              H.FillRoundedPath(G, H.GetHTMLColor("097A74"), new Rectangle(1, 1, Width - 2, 50), 5, true, true, false, false);
  285.        
  286.             G.DrawLine(H.PenHTMlColor("066762", 1), new Point(1, 51), new Point(Width - 2, 51));
  287.            
  288.             if (ShowIcon)
  289.                  {
  290.                      G.DrawIcon(FindForm().Icon, new Rectangle(5, 13, 20, 20));
  291.                      switch (TitleTextPostion)
  292.                      {
  293.                          case TitlePostion.Left:
  294.                              G.DrawString(Text, Font, Brushes.White, 27, 14);
  295.                              break;
  296.                          case TitlePostion.Center:
  297.                              H.CentreString(G, Text, Font, Brushes.White, new Rectangle(0, 0, Width, 50));
  298.                              break;
  299.                      }
  300.                  }
  301.                  else
  302.                  {
  303.                      switch (TitleTextPostion)
  304.                      {
  305.                          case TitlePostion.Left:
  306.                              G.DrawString(Text, Font, Brushes.White, 5, 14);
  307.                              break;
  308.                          case TitlePostion.Center:
  309.                              H.CentreString(G, Text, Font, Brushes.White, new Rectangle(0, 0, Width, 50));
  310.                              break;
  311.                      }
  312.                  }
  313.  
  314.  
  315.          e.Graphics.DrawImage((Image)(B.Clone()), 0, 0);
  316.          G.Dispose();
  317.          B.Dispose();
  318.  
  319.         }
  320.        
  321.     }
  322.  
  323.         #endregion
  324.  
  325.     }
  326.  
  327.     #endregion
  328.  
  329.     #region Switch
  330.  
  331.   [DefaultEvent("CheckedChanged")] public class GreenUISwitch : Control
  332.   {
  333.      
  334.       #region Variables
  335.  
  336.       private bool _Switch = false;
  337.       protected HelperMethods.MouseMode State = HelperMethods.MouseMode.NormalMode;
  338.       private Color _ForeColor  = Color.Gray;
  339.       private static HelperMethods H = new HelperMethods();
  340.  
  341.       #endregion
  342.  
  343.       #region Initialization
  344.  
  345.       public GreenUISwitch()
  346.       {
  347.           SetStyle( ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint |
  348.           ControlStyles.OptimizedDoubleBuffer | ControlStyles.SupportsTransparentBackColor, true);
  349.           DoubleBuffered = true;
  350.           UpdateStyles();
  351.           BackColor = Color.Transparent;
  352.           Cursor = Cursors.Hand;
  353.           Size = new Size(70, 28);
  354.       }
  355.  
  356.       #endregion
  357.  
  358.       #region Properties
  359.  
  360.       public bool Switched
  361.             {
  362.                 get { return _Switch; }
  363.  
  364.                 set { _Switch = value; }
  365.             }
  366.  
  367.       #endregion
  368.  
  369.       #region DrawControl
  370.  
  371.       protected override void OnPaint(PaintEventArgs e)
  372.       {
  373.           base.OnPaint(e);
  374.             Bitmap B = new Bitmap(Width, Height);
  375.           using (Graphics G = Graphics.FromImage(B))
  376.           {
  377.  
  378.                   G.SmoothingMode = SmoothingMode.HighQuality;
  379.                 G.TextRenderingHint = System.Drawing.Text.TextRenderingHint.ClearTypeGridFit;
  380.                 if (Switched)
  381.                 {
  382.  
  383.                     H.FillRoundedPath(G, H.GetHTMLColor("097A74"), new Rectangle(0, 0, 70, 27), 8);
  384.  
  385.                     H.FillRoundedPath(G, Color.WhiteSmoke, new Rectangle(Convert.ToInt32(Width - 28.5), Convert.ToInt32(1.5), 25, 23), 8);
  386.                     G.DrawLine(Pens.Gray, Width - 14, 8, Width - 14, 18);
  387.                     G.DrawLine(Pens.Gray, Width - 16, 8, Width - 16, 18);
  388.                     G.DrawLine(Pens.Gray, Width - 18, 8, Width - 18, 18);
  389.                     H.DrawRoundedPath(G, H.GetHTMLColor("056b65"), 1, new Rectangle(0, 0, 69, 27), 8);
  390.                     G.DrawString("ON", new Font("Proxima Nova", 10, FontStyle.Bold), Brushes.WhiteSmoke, new Point(Width - 62, 6));
  391.                }
  392.               else
  393.                 {
  394.                     H.FillRoundedPath(G, Color.Silver, new Rectangle(0, 0, 70, 27), 8);
  395.  
  396.                     H.FillRoundedPath(G, Color.WhiteSmoke, new Rectangle(3, Convert.ToInt32(1.5), 25, 23), 8);
  397.                     G.DrawLine(Pens.Gray, 13, 8, 13, 18);
  398.                     G.DrawLine(Pens.Gray, 15, 8, 15, 18);
  399.                     G.DrawLine(Pens.Gray, 17, 8, 17, 18);
  400.                     H.DrawRoundedPath(G, H.GetHTMLColor("bbbaba"), 1, new Rectangle(0, 0, 69, 27), 8);
  401.                     G.DrawString("OFF", new Font("Proxima Nova", 10, FontStyle.Bold), Brushes.WhiteSmoke, new Point(31, 6));
  402.  
  403.                 }
  404.  
  405.           }
  406.           e.Graphics.DrawImage((Image)(B.Clone()), 0, 0);
  407.       }
  408.  
  409.       #endregion
  410.  
  411.       #region   Mouse & Other Events  
  412.  
  413.         public event CheckedChangedEventHandler CheckedChanged;
  414.         public delegate void CheckedChangedEventHandler(object sender);
  415.  
  416.         protected override void OnMouseDown(MouseEventArgs e)
  417.         {
  418.             base.OnMouseDown(e);
  419.               State = HelperMethods.MouseMode.Pushed;
  420.               Invalidate();
  421.         }
  422.        
  423.         protected override void OnMouseEnter(EventArgs e)
  424.         {
  425.             base.OnMouseEnter(e);
  426.               State = HelperMethods.MouseMode.Hovered;
  427.               Invalidate();
  428.         }
  429.  
  430.         protected override void OnMouseLeave(EventArgs e)
  431.         {
  432.             base.OnMouseLeave(e);
  433.             State = HelperMethods.MouseMode.NormalMode;
  434.             Invalidate();
  435.         }
  436.  
  437.         protected override void OnMouseUp(MouseEventArgs e)
  438.         {
  439.             base.OnMouseUp(e);
  440.             State = HelperMethods.MouseMode.Hovered;
  441.             Invalidate();
  442.         }
  443.  
  444.         protected override void OnClick(EventArgs e)
  445.         {
  446.            
  447.              _Switch = ! _Switch;
  448.              if (CheckedChanged != null)
  449.              {
  450.                  CheckedChanged(this);
  451.              }
  452.         base.OnClick(e);
  453.         }
  454.  
  455.         protected override void OnResize(EventArgs e)
  456.       {
  457.           base.OnResize(e);
  458.           Size = new Size(70, 28);
  459.       }
  460.  
  461. #endregion
  462.  
  463.   }
  464.  
  465.     #endregion
  466.  
  467.     #region Trackbar
  468.  
  469.     [DefaultEvent("Scroll")]  public class GreenUITrackbar : Control
  470.   {
  471.  
  472.       #region Variables
  473.  
  474.       private int _Maximum = 100;
  475.       private int _Minimum;
  476.       private int _Value;
  477.       private int CurrentValue;
  478.       private Point P1, P2, P3, P4, P5, P6 ;
  479.       bool Variable;
  480.       Rectangle Track;
  481.       private static HelperMethods H = new HelperMethods();
  482.  
  483.       #endregion
  484.  
  485.       #region properties
  486.  
  487.       public int Minimum
  488.       {
  489.           get
  490.           {
  491.               return _Minimum;
  492.  
  493.           }
  494.  
  495.           set
  496.           {
  497.               if (!( value < 0))
  498.               {
  499.                 _Minimum = value;
  500.                 RenewCurrentValue();
  501.                 MoveTrack();
  502.                 Invalidate();
  503.               }
  504.  
  505.           }
  506.       }
  507.  
  508.       public int Maximum
  509.       {
  510.           get
  511.           {
  512.               return _Maximum;
  513.  
  514.           }
  515.           set
  516.           {
  517.             _Maximum = value;
  518.             RenewCurrentValue();
  519.             MoveTrack();
  520.             Invalidate();
  521.  
  522.           }
  523.       }
  524.  
  525.       public int Value
  526.       {
  527.           get
  528.           {
  529.               return _Value;
  530.           }
  531.           set
  532.           {
  533.               if (value != _Value)
  534.               {
  535.                   _Value = value;
  536.                   RenewCurrentValue();
  537.                   MoveTrack();
  538.                   Invalidate();
  539.                   if (Scroll != null)
  540.                       Scroll(this);
  541.  
  542.               }
  543.  
  544.           }
  545.       }
  546.  
  547.      
  548.       #endregion
  549.  
  550.       #region Initialization
  551.  
  552.       public GreenUITrackbar()
  553.       {
  554.           SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint |
  555.           ControlStyles.ResizeRedraw | ControlStyles.UserPaint |
  556.           ControlStyles.SupportsTransparentBackColor, true);
  557.           DoubleBuffered = true;
  558.           UpdateStyles();
  559.           CurrentValue=(int)Math.Round((double)(Value / Maximum) * (Double)Width);
  560.       }
  561.  
  562.       #endregion
  563.  
  564.       #region DrawControl
  565.  
  566.       protected override void OnPaint(PaintEventArgs e)
  567.       {
  568.           base.OnPaint(e);
  569.           Bitmap B = new Bitmap(Width, Height);
  570.           using (Graphics G = Graphics.FromImage(B))
  571.           {
  572.  
  573.               Cursor = Cursors.Hand;
  574.                 G.SmoothingMode = SmoothingMode.AntiAlias;
  575.                 G.PixelOffsetMode = PixelOffsetMode.HighQuality;
  576.                 G.InterpolationMode = InterpolationMode.HighQualityBicubic;
  577.  
  578.               H.FillRoundedPath(G, Color.Silver, new Rectangle(0, 6, Width, 12), 8);
  579.               H.DrawRoundedPath(G, Color.FromArgb(200, Color.DarkGray), 1, new Rectangle(0, Convert.ToInt32(5.5), Width, 12), 8);
  580.            
  581.               if (CurrentValue != 0)
  582.               {
  583.                   H.FillRoundedPath(G, H.GetHTMLColor("097A74"), new Rectangle(0, 6, CurrentValue + 2, 12), 5);
  584.               }
  585.  
  586.               G.PixelOffsetMode = PixelOffsetMode.None;
  587.  
  588.               H.FillRoundedPath(G, H.GetHTMLColor("c2c2c2"), Track, 6);
  589.               H.FillRoundedPath(G, Color.WhiteSmoke, Track, 6);
  590.               H.DrawRoundedPath(G, Color.FromArgb(60, Color.DarkGray), 1, Track, 6);
  591.               G.DrawLine(Pens.Gray, P1, P2);
  592.               G.DrawLine(Pens.Gray, P3, P4);
  593.               G.DrawLine(Pens.Gray, P5, P6);
  594.  
  595.           e.Graphics.DrawImage((Image)B.Clone(), 0, 0);
  596.           G.Dispose();
  597.           B.Dispose();
  598.           }
  599.  
  600.       }
  601.       #endregion
  602.  
  603.       #region Mouse & Other Events
  604.  
  605.       public event ScrollEventHandler Scroll;
  606.       public delegate void ScrollEventHandler(object sender);
  607.  
  608.       protected override void OnMouseMove(MouseEventArgs e)
  609.       {
  610.           if (Variable && e.X > -1 && e.X < Width + 1)
  611.           {
  612.               Value = Minimum + (int)Math.Round((double)(Maximum - Minimum) * (double)e.X / Width);
  613.           }
  614.              
  615.           base.OnMouseMove(e);
  616.       }
  617.      
  618.       protected override void OnMouseDown(MouseEventArgs e)
  619.       {
  620.           if (e.Button == MouseButtons.Left && Height > 0)
  621.           {
  622.               RenewCurrentValue();
  623.               if (Width > 0 && Height > 0) Track = new Rectangle(Convert.ToInt32(CurrentValue + 0.8), 0, 25, 24);
  624.        
  625.               Variable = new Rectangle(CurrentValue, 0, 24, Height).Contains(e.Location);
  626.           }
  627.           base.OnMouseDown(e);
  628.       }
  629.  
  630.       protected override void OnMouseUp(MouseEventArgs e)
  631.       {
  632.           Variable = false;
  633.           base.OnMouseUp(e);
  634.       }
  635.  
  636.       protected override void OnKeyDown(KeyEventArgs e)
  637.       {
  638.           if (e.KeyCode == Keys.Subtract || e.KeyCode == Keys.Down || e.KeyCode==Keys.Left)
  639.           {
  640.               if (Value != 0)            
  641.               {
  642.                   Value -= 1;
  643.  
  644.               }
  645.              
  646.           }
  647.           else if (e.KeyCode == Keys.Add || e.KeyCode == Keys.Up || e.KeyCode == Keys.Right)
  648.           {
  649.               if (Value != Maximum)
  650.               {
  651.                   Value += 1;
  652.               }
  653.              
  654.           }
  655.           base.OnKeyDown(e);
  656.       }
  657.  
  658.       protected override void OnResize(EventArgs e)
  659.       {
  660.                if (Width > 0 && Height > 0)
  661.                {
  662.             RenewCurrentValue();
  663.             MoveTrack();
  664.             Height = 25;
  665.                }
  666.  
  667.                Invalidate();
  668.           base.OnResize(e);
  669.       }
  670.  
  671.       public void MoveTrack()
  672.           {
  673.         if (Height > 0 && Width > 0)
  674.           {
  675.       Track = new Rectangle(Convert.ToInt32(CurrentValue - 0.4), 0, 25, 23);
  676.           }
  677.         P1 = new Point(CurrentValue + 9, Track.Y + 5);
  678.         P2 = new Point(CurrentValue + 9, Track.Height - 5);
  679.         P3 = new Point(CurrentValue + 12, Track.Y + 5);
  680.         P4 = new Point(CurrentValue + 12, Track.Height - 5);
  681.         P5 = new Point(CurrentValue + 15, Track.Y + 5);
  682.         P6 = new Point(CurrentValue + 15, Track.Height - 5);
  683.           }
  684.  
  685.       public void RenewCurrentValue()
  686.           {
  687.              
  688.               CurrentValue = (int)Math.Round((double)(Value - Minimum) / (double)(Maximum - Minimum) * (double)(Width - 25));
  689.           }
  690.  
  691.       #endregion
  692.  
  693.   }
  694.  
  695.     #endregion
  696.  
  697.     #region Button
  698.  
  699.     public class GreenUIButton : Control
  700.   {
  701.  
  702.  
  703.       #region Variables
  704.  
  705.       private HelperMethods.MouseMode State;
  706.       private static HelperMethods H = new HelperMethods();
  707.  
  708.       #endregion
  709.  
  710.       #region Initialization
  711.  
  712.       public GreenUIButton()
  713.       {
  714.           SetStyle(ControlStyles.DoubleBuffer | ControlStyles.AllPaintingInWmPaint | ControlStyles.ResizeRedraw | ControlStyles.UserPaint |
  715.           ControlStyles.Selectable | ControlStyles.SupportsTransparentBackColor, true);
  716.           DoubleBuffered = true;
  717.           UpdateStyles();
  718.           Font = new Font("Proxima Nova", 10, FontStyle.Bold);
  719.       }
  720.  
  721.       #endregion
  722.  
  723.       #region DrawControl
  724.  
  725.       protected override void OnPaint(PaintEventArgs e)
  726.       {
  727.  
  728.           Rectangle Rect = new Rectangle(0, 0, Width -1, Height -1);
  729.           Bitmap B = new Bitmap(Width, Height);
  730.           using (Graphics G = Graphics.FromImage(B))
  731.           {
  732.               G.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias;
  733.               G.SmoothingMode = SmoothingMode.HighQuality;
  734.  
  735.               switch (State)
  736.               {
  737.                   case HelperMethods.MouseMode.NormalMode:
  738.                     H.FillRoundedPath(G, H.GetHTMLColor("097A74"), Rect, 12);
  739.                     H.DrawRoundedPath(G, H.GetHTMLColor("e0e0e0"), 1, Rect, 12);
  740.                     H.CentreString(G, Text, Font, Brushes.White, Rect);
  741.                     break;
  742.                   case HelperMethods.MouseMode.Hovered:
  743.                     Cursor = Cursors.Hand;
  744.                     H.FillRoundedPath(G, H.GetHTMLColor("06514C"), Rect, 12);
  745.                     H.DrawRoundedPath(G, H.GetHTMLColor("9d92a8"), 1, Rect, 12);
  746.                     H.CentreString(G, Text, Font, H.SolidBrushHTMlColor("ffffff"), Rect);
  747.                     break;
  748.                   case HelperMethods.MouseMode.Pushed:
  749.                     H.FillRoundedPath(G, H.GetHTMLColor("21272c"), Rect, 12);
  750.                     H.DrawRoundedPath(G, H.GetHTMLColor("444444"), 1, Rect, 12);
  751.                     H.CentreString(G, Text, Font, H.SolidBrushHTMlColor("444444"), Rect);
  752.                     break;
  753.               }
  754.              e.Graphics.DrawImage((Image)(B.Clone()), 0, 0);
  755.              G.Dispose();
  756.              B.Dispose();
  757.           }
  758.          
  759.          
  760.       }
  761.  
  762.       #endregion
  763.  
  764.       #region Mouse Events
  765.  
  766.       protected override void OnMouseEnter(EventArgs e)
  767.       {
  768.          
  769.           base.OnMouseEnter(e);
  770.           State = HelperMethods.MouseMode.Hovered;
  771.           Invalidate();
  772.       }
  773.  
  774.       protected override void OnMouseUp(MouseEventArgs e)
  775.       {
  776.          
  777.         base.OnMouseUp(e);
  778.         State = HelperMethods.MouseMode.Hovered;
  779.         Invalidate();
  780.       }
  781.  
  782.       protected override void OnMouseDown(MouseEventArgs e)
  783.       {
  784.          
  785.          base.OnMouseDown(e);
  786.          State = HelperMethods.MouseMode.Pushed;
  787.          Invalidate();
  788.       }
  789.  
  790.       protected override void OnMouseLeave(EventArgs e)
  791.       {
  792.          
  793.          base.OnMouseLeave(e);
  794.          State = HelperMethods.MouseMode.NormalMode;
  795.          Invalidate();
  796.       }
  797.  
  798.       #endregion
  799.  
  800.   }
  801.    
  802.     #endregion
  803.  
  804.     #region CheckBox
  805.  
  806.   [DefaultEvent("CheckedChanged")]  public class GreenUICheckBox : Control
  807.   {
  808.      
  809.       #region Variables
  810.  
  811.          private bool _Checked;
  812.          protected HelperMethods.MouseMode State = HelperMethods.MouseMode.NormalMode;
  813.          private  Color _BackColor = Color.WhiteSmoke;
  814.          private Color  _ForeColor = Color.Gray;
  815.          private static HelperMethods H = new HelperMethods();
  816.  
  817.       #endregion
  818.  
  819.       #region Properties
  820.  
  821.          protected override void OnTextChanged(EventArgs e)
  822.          {
  823.              base.OnTextChanged(e);
  824.              Invalidate();
  825.          }
  826.  
  827.          public bool Checked
  828.          {
  829.              get
  830.              {
  831.                  return _Checked;
  832.              }
  833.              set
  834.              {
  835.                  _Checked = value;
  836.                  Invalidate();
  837.              }
  838.          }
  839.  
  840.          #endregion
  841.  
  842.       #region Initialization
  843.  
  844.          public GreenUICheckBox()
  845.       {
  846.           SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint |
  847.                    ControlStyles.ResizeRedraw | ControlStyles.OptimizedDoubleBuffer
  848.                    | ControlStyles.SupportsTransparentBackColor | ControlStyles.UseTextForAccessibility,true);
  849.           DoubleBuffered = true;
  850.           UpdateStyles();
  851.                   Cursor = Cursors.Hand;
  852.         Size = new Size(200, 20);
  853.         Font = new Font("Proxima Nova", 11, FontStyle.Regular);
  854.       }
  855.  
  856.       #endregion
  857.  
  858.       #region DrawControl
  859.  
  860.       protected override void OnPaint(PaintEventArgs e)
  861.       {
  862.           base.OnPaint(e);
  863.           Bitmap B = new Bitmap(Width, Height);
  864.           using (Graphics G = Graphics.FromImage(B))
  865.           {
  866.  
  867.                 G.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias;
  868.                 G.PixelOffsetMode = PixelOffsetMode.Half;
  869.  
  870.              if (Checked)
  871.               {
  872.                     H.FillRoundedPath(G, H.GetHTMLColor("097A74"), new Rectangle(4, 4, 12, 12), 2);
  873.                     H.DrawRoundedPath(G, H.GetHTMLColor("097A74"), 2, new Rectangle(1, 1, 18, 18), 2);
  874.                     G.DrawString(Text, Font, H.SolidBrushHTMlColor("097A74"), new Rectangle(22, +(int)1.6, Width, Height - 2), new StringFormat { Alignment = StringAlignment.Near, LineAlignment = StringAlignment.Center });
  875.               }
  876.              else
  877.               {
  878.                     H.FillRoundedPath(G, Color.Silver, new Rectangle(4, 4, 12, 12), 2);
  879.                     H.DrawRoundedPath(G, Color.Silver, 2, new Rectangle(1, 1, 18, 18), 2);
  880.                     G.DrawString(Text, Font, Brushes.DimGray, new Rectangle(22, +(int) 1.6, Width, Height - 2), new StringFormat {Alignment = StringAlignment.Near, LineAlignment = StringAlignment.Center});
  881.               }
  882.  
  883.             e.Graphics.DrawImage((Image)(B.Clone()), 0, 0);
  884.             G.Dispose();
  885.             B.Dispose();
  886.           }
  887.          
  888.          
  889.       }
  890.  
  891.       #endregion
  892.  
  893.       #region  Mouse & Other Events
  894.  
  895.       public event CheckedChangedEventHandler CheckedChanged;
  896.       public delegate void CheckedChangedEventHandler(object sender);
  897.  
  898.       protected override void OnMouseEnter(EventArgs e)
  899.       {
  900.  
  901.           base.OnMouseEnter(e);
  902.           State = HelperMethods.MouseMode.Hovered;
  903.           Invalidate();
  904.       }
  905.  
  906.       protected override void OnMouseUp(MouseEventArgs e)
  907.       {
  908.  
  909.           base.OnMouseUp(e);
  910.           State = HelperMethods.MouseMode.Hovered;
  911.           Invalidate();
  912.       }
  913.  
  914.       protected override void OnMouseDown(MouseEventArgs e)
  915.       {
  916.  
  917.           base.OnMouseDown(e);
  918.           State = HelperMethods.MouseMode.Pushed;
  919.           Invalidate();
  920.       }
  921.  
  922.       protected override void OnMouseLeave(EventArgs e)
  923.       {
  924.  
  925.           base.OnMouseLeave(e);
  926.           State = HelperMethods.MouseMode.NormalMode;
  927.           Invalidate();
  928.       }
  929.  
  930.       protected override void OnResize(EventArgs e)
  931.       {
  932.           Height = 20;
  933.           Invalidate();
  934.           base.OnResize(e);
  935.       }
  936.  
  937.       protected override void OnClick(EventArgs e)
  938.       {
  939.           _Checked = !_Checked;
  940.           if (CheckedChanged != null)
  941.           {
  942.               CheckedChanged(this);
  943.           }
  944.           base.OnClick(e);
  945.       }
  946.  
  947.       protected override void OnCreateControl()
  948.       {
  949.           base.OnCreateControl();
  950.           BackColor = Color.Transparent;
  951.       }
  952.  
  953.      #endregion
  954.  
  955.   }
  956.    
  957.     #endregion
  958.  
  959.     #region RadioButton
  960.  
  961.   [DefaultEvent("CheckedChanged")] public class GreenUIRadioButton : Control
  962.   {
  963.  
  964.       #region Variables
  965.  
  966.       private bool _Checked;
  967.       private int _Group = 1;
  968.       protected HelperMethods.MouseMode State = HelperMethods.MouseMode.NormalMode;
  969.       private Color _BackColor = Color.WhiteSmoke;
  970.       private Color _ForeColor = Color.Gray;
  971.       private static HelperMethods H = new HelperMethods();
  972.       public event CheckedChangedEventHandler CheckedChanged;
  973.       public delegate void CheckedChangedEventHandler(object sender);
  974.  
  975.       #endregion
  976.  
  977.       #region Properties
  978.  
  979.       protected override void OnTextChanged(EventArgs e)
  980.       {
  981.           base.OnTextChanged(e);
  982.           Invalidate();
  983.       }
  984.  
  985.       public bool Checked
  986.       {
  987.           get
  988.           {
  989.               return _Checked;
  990.           }
  991.           set
  992.           {
  993.               _Checked = value;
  994.               UpdateCheckState();
  995.               Invalidate();
  996.           }
  997.       }
  998.  
  999.       public int Group
  1000.       {
  1001.           get
  1002.           {
  1003.               return _Group;
  1004.           }
  1005.           set
  1006.           {
  1007.               _Group = value;
  1008.           }
  1009.       }
  1010.  
  1011.       #endregion
  1012.  
  1013.       #region Initialization
  1014.  
  1015.       public GreenUIRadioButton()
  1016.       {
  1017.           SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint |
  1018.                    ControlStyles.ResizeRedraw | ControlStyles.OptimizedDoubleBuffer
  1019.                    | ControlStyles.SupportsTransparentBackColor | ControlStyles.UseTextForAccessibility, true);
  1020.           DoubleBuffered = true;
  1021.           Cursor = Cursors.Hand;
  1022.           Size = new Size(200, 20);
  1023.           Font = new Font("Proxima Nova", 11, FontStyle.Regular);
  1024.           UpdateStyles();
  1025.       }
  1026.  
  1027.       #endregion
  1028.  
  1029.       #region DrawControl
  1030.  
  1031.       protected override void OnPaint(PaintEventArgs e)
  1032.       {
  1033.           //base.OnPaint(e);
  1034.           Bitmap B = new Bitmap(Width, Height);
  1035.           using (Graphics G = Graphics.FromImage(B))
  1036.           {
  1037.  
  1038.               G.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias;
  1039.               G.SmoothingMode = SmoothingMode.AntiAlias;
  1040.  
  1041.               if (Checked)
  1042.               {
  1043.                     G.DrawEllipse(H.PenHTMlColor("097A74", 2), 1, 1, 18, 18);
  1044.                     G.FillEllipse(H.SolidBrushHTMlColor("097A74"), new Rectangle(4, 4, 12, 12));
  1045.                     G.DrawString(Text, Font, H.SolidBrushHTMlColor("097A74"), new Rectangle(23, -1, Width, Height));
  1046.               }
  1047.               else
  1048.               {
  1049.                   G.DrawEllipse(new Pen(Color.Silver,2), 1, 1, 18, 18);
  1050.                   G.FillEllipse(Brushes.Silver, new Rectangle(4, 4, 12, 12));
  1051.                   G.DrawString(Text, Font, Brushes.Gray, new Rectangle(23, -1, Width, Height));
  1052.               }
  1053.                
  1054.               e.Graphics.DrawImage((Image)(B.Clone()), 0, 0);
  1055.               G.Dispose();
  1056.               B.Dispose();
  1057.           }
  1058.  
  1059.  
  1060.       }
  1061.  
  1062.       #endregion
  1063.  
  1064.       #region  Events
  1065.  
  1066.       private void UpdateCheckState()
  1067.       {
  1068.           if (!IsHandleCreated || !_Checked)
  1069.               return;
  1070.  
  1071.           foreach (Control C in Parent.Controls)
  1072.           {
  1073.               if (!object.ReferenceEquals(C, this) && C is GreenUIRadioButton && ((GreenUIRadioButton)C).Group == _Group)
  1074.               {
  1075.                   ((GreenUIRadioButton)C).Checked = false;
  1076.               }
  1077.           }
  1078.           if (CheckedChanged != null)
  1079.           {
  1080.               CheckedChanged(this);
  1081.           }
  1082.       }
  1083.  
  1084.       protected override void OnMouseDown(MouseEventArgs e)
  1085.       {
  1086.           if (!_Checked)
  1087.               Checked = true;
  1088.           base.OnMouseDown(e);
  1089.       }
  1090.  
  1091.       protected override void OnMouseHover(EventArgs e)
  1092.       {
  1093.           base.OnMouseHover(e);
  1094.           State = HelperMethods.MouseMode.Hovered;
  1095.           Invalidate();
  1096.       }
  1097.  
  1098.       protected override void OnMouseLeave(EventArgs e)
  1099.       {
  1100.           base.OnMouseLeave(e);
  1101.           State = HelperMethods.MouseMode.NormalMode;
  1102.           Invalidate();
  1103.       }
  1104.  
  1105.       protected override void OnResize(EventArgs e)
  1106.       {
  1107.           base.OnResize(e);
  1108.           Height = 21;
  1109.           Invalidate();
  1110.       }
  1111.  
  1112.       protected override void OnCreateControl()
  1113.       {
  1114.           base.OnCreateControl();
  1115.           UpdateCheckState();
  1116.       }
  1117.  
  1118.       #endregion
  1119.  
  1120.   }
  1121.    
  1122.  
  1123.     #endregion
  1124.  
  1125.     #region ProgressBar
  1126.  
  1127.   [DefaultEvent("ValueChanged")]  public class GreenUIProgressBar : Control
  1128.   {
  1129.  
  1130.  
  1131.       #region Variables
  1132.  
  1133.       private int _Maximum = 100;
  1134.       private int _Value;
  1135.       int CurrentValue;
  1136.       private static HelperMethods H = new HelperMethods();
  1137.  
  1138.       #endregion
  1139.  
  1140.       #region Initialization
  1141.  
  1142.       public GreenUIProgressBar()
  1143.       {
  1144.           SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.ResizeRedraw |
  1145.                        ControlStyles.OptimizedDoubleBuffer | ControlStyles.SupportsTransparentBackColor, true);
  1146.                     DoubleBuffered = true;
  1147.                     UpdateStyles();
  1148.           Size = new Size(75, 23);
  1149.           CurrentValue = (int)Math.Round((double)(Value / Maximum) * (double)Width);
  1150.       }
  1151.  
  1152.       #endregion
  1153.  
  1154.       #region Properties
  1155.  
  1156.       public int Value
  1157.       {
  1158.           get
  1159.           {
  1160.               if (_Value < 0)
  1161.               {
  1162.                   return 0;
  1163.               }
  1164.               else
  1165.               {
  1166.                   return _Value;
  1167.               }            
  1168.           }
  1169.           set
  1170.           {
  1171.               if (value > Maximum)
  1172.               {
  1173.                   _Value = Maximum;
  1174.               }
  1175.               _Value = value;
  1176.               RenewCurrentValue();
  1177.               Invalidate();
  1178.               if (ValueChanged != null)
  1179.                   ValueChanged(this);
  1180.              
  1181.           }
  1182.       }
  1183.  
  1184.       public int Maximum
  1185.       {
  1186.           get
  1187.           {
  1188.               return _Maximum;
  1189.            
  1190.           }
  1191.           set
  1192.           {
  1193.               if (_Maximum < value)
  1194.               {
  1195.                   _Value =value ;
  1196.               }
  1197.               _Maximum = value;
  1198.               Invalidate();
  1199.           }
  1200.       }
  1201.  
  1202.       #endregion
  1203.  
  1204.       #region DrawControl
  1205.  
  1206.       protected override void OnPaint(PaintEventArgs e)
  1207.       {
  1208.           Rectangle Rect = new Rectangle(0, 0, Width, Height);
  1209.           Bitmap B = new Bitmap(Width, Height);
  1210.           using (Graphics G = Graphics.FromImage(B))
  1211.           {
  1212.                 G.SmoothingMode = SmoothingMode.AntiAlias;
  1213.                 G.PixelOffsetMode = PixelOffsetMode.HighQuality;
  1214.                 G.InterpolationMode = InterpolationMode.HighQualityBicubic;
  1215.              
  1216.                 H.FillRoundedPath(G, Color.Silver, Rect, 8);
  1217.                 H.DrawRoundedPath(G, Color.FromArgb(200, Color.DarkGray), 1, Rect, 8);
  1218.              
  1219.               if (CurrentValue != 0)
  1220.                 {
  1221.                    H.FillRoundedPath(G, H.GetHTMLColor("097A74"), new Rectangle(Rect.X, Rect.Y, CurrentValue, Rect.Height), 8);
  1222.                 }
  1223.  
  1224.               e.Graphics.DrawImage((Image)(B.Clone()), 0, 0);
  1225.               G.Dispose();
  1226.               B.Dispose();
  1227.           }
  1228.  
  1229.       }
  1230.  
  1231.       #endregion
  1232.  
  1233.       #region Events
  1234.  
  1235.       public event ValueChangedEventHandler ValueChanged;
  1236.       public delegate void ValueChangedEventHandler(object sender);
  1237.       public void RenewCurrentValue()
  1238.       {
  1239.  
  1240.           CurrentValue = (int)Math.Round((double)(Value) / (double)(Maximum ) * (double)(Width));
  1241.       }
  1242.  
  1243.       #endregion
  1244.  
  1245.   }
  1246.    
  1247.     #endregion
  1248.  
  1249.     #region Textbox
  1250.     [DefaultEvent("TextChanged")]
  1251.   public class GreenUITextbox : Control
  1252.   {
  1253.  
  1254.       #region Variables
  1255.  
  1256.       private TextBox T = new TextBox();
  1257.       private HorizontalAlignment _TextAlign = HorizontalAlignment.Left;
  1258.       private int _MaxLength=32767;
  1259.       private bool _ReadOnly;
  1260.       private bool _UseSystemPasswordChar=false;
  1261.       private string _WatermarkText = "";
  1262.       private Image _SideImage;
  1263.       private Color TBC = Color.Silver;
  1264.       private Color TFC = Color.Gray;
  1265.       private bool _Multiline = false;
  1266.       private static HelperMethods H = new HelperMethods();
  1267.  
  1268.       #endregion
  1269.  
  1270.       #region Initialization
  1271.  
  1272.       public GreenUITextbox()
  1273.       {
  1274.           SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint |
  1275.                   ControlStyles.ResizeRedraw | ControlStyles.OptimizedDoubleBuffer |
  1276.                   ControlStyles.SupportsTransparentBackColor, true);
  1277.           DoubleBuffered = true;
  1278.           UpdateStyles();
  1279.           Text = WatermarkText;
  1280.           Size = new Size(135, 30);
  1281.           Font = new Font("Proxima Nova", 11, FontStyle.Regular);
  1282.             T.Multiline = _Multiline;
  1283.             T.Cursor = Cursors.IBeam;
  1284.             T.BackColor = TBC;
  1285.             T.ForeColor = Color.Gray;
  1286.             T.Text = WatermarkText;
  1287.             T.BorderStyle = BorderStyle.None;
  1288.             T.Location = new Point(7, 7);
  1289.             T.Font = Font;
  1290.             T.Size = new Size(Width - 10, 30);
  1291.             T.UseSystemPasswordChar = _UseSystemPasswordChar;
  1292.             T.TextChanged += T_TextChanged;
  1293.             T.Leave += T_Leave;
  1294.             T.Enter+=T_Enter;
  1295.             T.KeyDown += T_KeyDown;
  1296.        }
  1297.  
  1298.       #endregion
  1299.  
  1300.       #region Properties
  1301.  
  1302.       [Browsable(false), EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
  1303.       public BorderStyle BorderStyle
  1304.       {
  1305.           get
  1306.           {
  1307.               return BorderStyle.None;
  1308.           }
  1309.       }
  1310.  
  1311.       [Browsable(false), EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
  1312.       public bool Multiline
  1313.       {
  1314.           get
  1315.           {
  1316.               return _Multiline;
  1317.           }
  1318.           set
  1319.           {
  1320.               _Multiline = value;
  1321.               if (T != null)
  1322.               {
  1323.                   T.Multiline = value;
  1324.               }
  1325.  
  1326.           }
  1327.       }
  1328.  
  1329.       public HorizontalAlignment TextAlign
  1330.       {
  1331.           get          
  1332.           {              
  1333.               return _TextAlign;          
  1334.           }
  1335.          set
  1336.           {
  1337.               _TextAlign=value;
  1338.               if(T !=null)
  1339.               {
  1340.                   T.TextAlign = value;
  1341.               }
  1342.           }
  1343.       }
  1344.  
  1345.       public int MaxLength
  1346.       {
  1347.           get
  1348.           {
  1349.               return _MaxLength;
  1350.           }
  1351.           set
  1352.           {
  1353.               _MaxLength = value;
  1354.               if (T != null)
  1355.               {
  1356.                   T.MaxLength = value;
  1357.               }
  1358.           }
  1359.       }
  1360.  
  1361.       public bool ReadOnly
  1362.       {
  1363.           get
  1364.           {
  1365.               return _ReadOnly;
  1366.           }
  1367.           set
  1368.           {
  1369.               _ReadOnly = value;
  1370.               if (T != null)
  1371.               {
  1372.                   T.ReadOnly = value;
  1373.               }
  1374.           }
  1375.       }
  1376.  
  1377.       public bool UseSystemPasswordChar
  1378.       {
  1379.           get
  1380.           {
  1381.               return _UseSystemPasswordChar;
  1382.           }
  1383.           set
  1384.           {
  1385.               _UseSystemPasswordChar = value;
  1386.               if (T != null)
  1387.               {
  1388.                   T.UseSystemPasswordChar = value;
  1389.               }
  1390.           }
  1391.       }
  1392.  
  1393.       public string WatermarkText
  1394.       {
  1395.           get
  1396.           {
  1397.               return _WatermarkText;
  1398.           }
  1399.           set
  1400.           {
  1401.               _WatermarkText = value;
  1402.              
  1403.           }
  1404.       }
  1405.  
  1406.       public Image SideImage
  1407.       {
  1408.           get
  1409.           {
  1410.               return _SideImage;
  1411.           }
  1412.           set
  1413.           {
  1414.               _SideImage = value;
  1415.               Invalidate();
  1416.           }
  1417.       }
  1418.  
  1419.       [Browsable(false)]
  1420.       public override Image BackgroundImage
  1421.       {
  1422.           get
  1423.           {
  1424.               return base.BackgroundImage;
  1425.           }
  1426.           set
  1427.           {
  1428.               base.BackgroundImage = value;
  1429.           }
  1430.       }
  1431.  
  1432.       [Browsable(false)]
  1433.       public override ImageLayout BackgroundImageLayout
  1434.       {
  1435.           get
  1436.           {
  1437.               return base.BackgroundImageLayout;
  1438.           }
  1439.           set
  1440.           {
  1441.               base.BackgroundImageLayout = value;
  1442.           }
  1443.       }
  1444.  
  1445.       public override string Text
  1446.       {
  1447.           get
  1448.           {
  1449.               return base.Text;
  1450.           }
  1451.           set
  1452.           {
  1453.               base.Text = value;
  1454.           }
  1455.       }
  1456.  
  1457.       #endregion
  1458.  
  1459.       #region DrawControl
  1460.  
  1461.       protected override void OnPaint(PaintEventArgs e)
  1462.       {
  1463.    
  1464.           Rectangle Rect = new Rectangle(0, 0, Width-1, Height-1);
  1465.           Bitmap B = new Bitmap(Width, Height);
  1466.           using (Graphics G = Graphics.FromImage(B))
  1467.           {
  1468.               Height = 30;
  1469.                 G.SmoothingMode = SmoothingMode.HighQuality;
  1470.                 G.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias;
  1471.                 G.InterpolationMode = InterpolationMode.HighQualityBicubic;
  1472.  
  1473.                 H.FillRoundedPath(G, TBC, Rect, 10);
  1474.                 H.DrawRoundedPath(G, Color.FromArgb(200, Color.DarkGray), 1, new Rectangle(0, 0, Width - 1, Height - 1), 10);
  1475.            
  1476.               if ( SideImage != null)
  1477.               {
  1478.                     T.Location = new Point(33, Convert.ToInt32(4.5));
  1479.                     T.Width = Width - 65;
  1480.                     G.DrawImage(SideImage, new Rectangle(8, 7, 16, 16));
  1481.               }              
  1482.               else
  1483.               {
  1484.                   T.Location = new Point(7, Convert.ToInt32(4.5));
  1485.                     T.Width = Width - 10;
  1486.               }
  1487.  
  1488.                 if (ContextMenuStrip != null) { T.ContextMenuStrip = ContextMenuStrip; }
  1489.  
  1490.               e.Graphics.DrawImage((Image)(B.Clone()), 0, 0);
  1491.               G.Dispose();
  1492.               B.Dispose();
  1493.           }
  1494.  
  1495.       }
  1496.  
  1497.       #endregion
  1498.  
  1499.       #region Events
  1500.  
  1501.       private void T_Leave(object sender,EventArgs e)
  1502.       {
  1503.           if (Text.Length == 0)
  1504.           {
  1505.             Text = WatermarkText;
  1506.             T.ForeColor = TFC;
  1507.           }
  1508.       }
  1509.  
  1510.       private void T_Enter(object sender, EventArgs e)
  1511.       {
  1512.           if (Text == WatermarkText)
  1513.           {
  1514.               Text = "";
  1515.               T.ForeColor = TFC;
  1516.           }
  1517.       }
  1518.  
  1519.       private void T_TextChanged(object sender, EventArgs e)
  1520.       {
  1521.           Text = T.Text;
  1522.       }
  1523.  
  1524.       protected override void OnTextChanged(EventArgs e)
  1525.       {
  1526.           base.OnTextChanged(e);
  1527.           T.Text = Text;
  1528.       }
  1529.  
  1530.       private void T_KeyDown(object sender, KeyEventArgs e)
  1531.       {
  1532.           if (e.Control && e.KeyCode == Keys.A) { e.SuppressKeyPress = true; }
  1533.           if(e.Control && e.KeyCode==Keys.C)
  1534.           {
  1535.                  T.Copy();
  1536.                  e.SuppressKeyPress = true;
  1537.           }
  1538.       }
  1539.  
  1540.       protected override void OnCreateControl()
  1541.       {
  1542.           base.OnCreateControl();
  1543.            if (!Controls.Contains(T))
  1544.            Controls.Add(T);
  1545.         if (T.Text == "" && WatermarkText != "")
  1546.          
  1547.               T.Text = WatermarkText;
  1548.        
  1549.       }
  1550.  
  1551.       protected override void OnResize(EventArgs e)
  1552.       {
  1553.           base.OnResize(e);
  1554.           if (_Multiline == false)
  1555.               Height = 30;
  1556.       }
  1557.  
  1558.       #endregion
  1559.  
  1560.  
  1561.   }
  1562.    
  1563.     #endregion
  1564.  
  1565.     #region Close
  1566.     public class GreenUIClose : Control
  1567.   {
  1568.  
  1569.  
  1570.       #region Variables
  1571.  
  1572.       private string img = "iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAVDSURBVHjarJdPaxtHGMZ/78yuZlerXAyhBh/r1r0EArnmYOpG1EkoKeTUQD9AIZ+h0E8QWhoaSqFQ0kN7aqGkuAh88FVQMBQEuZoYDL5Uf3YlzUwPs7IlW5JXbhaGHLwZ/fZ53nnfZ0Tf/4gFTwN4CXwJ/M3bezaBb4DPgZPxH3/N/FEhMGc1RKlXEulPRKuWiNxe8N5KS0Q2Rat9ifTHolQL4eZFWjVPGVHqFaZ2l6wOSbKGVi1B7vwfWQTZRKt9kmQj7GtuiVKt6OG9m8uAZmCk0UAa2QRq77pQgmwFGLMhjbAvWR3MZSg1pWlDlH6FMXepZ0hahziGJCmh0jW0LqGq+xRgdIsk2ZCsASaFOEbSFBoNMMktUboVPWzeBBD94N6sMvV6eDnS55/oHBQFvtuHPD/F2qaH9tXKUMKYDckyMAb0lCnW4vMCuj0oikPv3I5W77/bED1lUz2FWM9+qBLQGtEKvE9x7rF43wLeLISREiZNNoLCBiJ1YV8V9tQKnHtHnLulRKuX1EqYi8rMVJsCY5DGpND1ngh3FsKoEibUyqwy04/WSGIgqx9hzFNFzXxFlp0GmGh5TSgNZrqmoj2R2ZoSkS1UtB9gMjAJaH3VvkdSM9ujX357rajFbTGmidanlY7MEqVKZfZJzfrcmpn/HOH8zvDFj6/DKbMW7LgNvolwWunwaAWJQW7UIU3WiPSeKPkMrfepm/WFNXN5HeHczvD5D50JXUQxxItCRNoY00SpPWDtaqVK+xA8ssZo9JI4ItRMUk0Z63aG357DBCBrIc/xAXpFqNI+BD8aIXEMtVplGIq8c2lLX/YD8hzf68OwaOPdivbVypqqVbaJYd7xvT5zZ1mAcjDIQ/Mrhm2cb4KcVurISoOOwr/L3z3G+h2KouO7A8gLFg5Xj5+C6kFRtHGuCZy+pdhxjHXbFHmn7Pjh95ZNe48PYyLP8b0SahX7Fq9jnNs+s6nIwbnwe5eBZv+n9xP7ilBT+Yr2zVvWP52xybrwOwhV8lAJZYN9vR7kRRvnvriWUWEwv/Dd/u1gky1hFhzcRR/lAVx5+vr9LYbDZ3i3ukB4vB2vMR61cO7OmTAyVyCWnlHvBazbYjja96PxOpd2q5Jb1aQ/lWPmYp6qYNns1Fb7xPG6xBGIrG7ZpHlm2ZUpYallIc+oFvV0XRpTEeI6da0VpAa5kYXZN4Gab9miDKxbpGmIEEl6dYSo0jyTJOTptIwuczK6WhDIW2d5Jqk0KKvbl5iQp0ql4kcPZqCUBHvKJZtEqiX1EDslTZBIMfvOpXUswhMRTq94LyytkNI+qYfoEn96DjX16eHeJEmyQZYh1ZQJHdjan1caM0qF2Bo+OihVQkn06H643modYBorwFi3zbDo+NEYiSMw5k7l6FI2zcmtww8Gp1jb1OqD964Dc4R1H/o879DtwSB0YJR6I1q3EHkMpFffIAXROijmfYq16xFaP5d0ZZgdX+Qdej38IAxK7BgBvNCWZIWQV9aUF38guCdKEvOERvbPSjClMgHGhuFnLX4wCPLnK0YXkQOJot3hT792FXF8InG8jdaHV/SSEqbo0O3jB0VQxk+Gn4QpPshLqMop4QDrdouvv++GUzYc4YvhCWO7AxwuVsaWMNPKXIwJ5fV4kEO3W0WpA8bj3eLZd93zTD0soNfDF/kJ1u4gHF7OwHbbF0WombyEWTRnz+7sOfS6+MUh7wA7C1Pey8qj928Xn+cXlTrC2m2fF6/PlLG2WlceL1XqgPF41/cH3fmjw82B8v7Pa8Msg/L+9zOYObeO/wYAIlO8U9aIgCsAAAAASUVORK5CYII=";
  1573.       private static HelperMethods H = new HelperMethods();
  1574.  
  1575.       #endregion
  1576.  
  1577.       #region Initialization
  1578.  
  1579.       public GreenUIClose()
  1580.       {
  1581.           SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint |
  1582.           ControlStyles.ResizeRedraw | ControlStyles.UserPaint |
  1583.           ControlStyles.SupportsTransparentBackColor, true);
  1584.           DoubleBuffered = true;
  1585.           UpdateStyles();
  1586.           BackColor = Color.Transparent;
  1587.           Size = new Size(22, 22);
  1588.       }
  1589.  
  1590.       #endregion
  1591.  
  1592.       #region DrawControl
  1593.  
  1594.       protected override void OnPaint(PaintEventArgs e)
  1595.       {
  1596.           base.OnPaint(e);
  1597.           Rectangle Rect = new Rectangle(0, 0, 22, 22);
  1598.           Bitmap B = new Bitmap(Width, Height);
  1599.           using (Graphics G = Graphics.FromImage(B))
  1600.           {
  1601.               G.Clear(Color.Transparent);
  1602.               H.DrawImageFromBase64(G, img, Rect);
  1603.               e.Graphics.DrawImage((Image)(B.Clone()), 0, 0);
  1604.               G.Dispose();
  1605.               B.Dispose();
  1606.           }
  1607.  
  1608.       }
  1609.  
  1610.       #endregion
  1611.  
  1612.       #region Events
  1613.  
  1614.       protected override void OnResize(EventArgs e)
  1615.       {
  1616.           base.OnResize(e);
  1617.           Size = new Size(22, 22);
  1618.       }
  1619.  
  1620.       protected override void OnClick(EventArgs e)
  1621.       {
  1622.           base.OnClick(e);
  1623.           Environment.Exit(0);
  1624.           Application.Exit();
  1625.       }
  1626.  
  1627.       #endregion
  1628.  
  1629.   }
  1630.    
  1631.     #endregion
  1632.  
  1633.     #region Seperator
  1634.  
  1635.     public class GreenUISeperator : Control
  1636.     {
  1637.  
  1638.         #region Variables
  1639.  
  1640.         private Style _SepStyle = Style.Horizental;
  1641.         private static HelperMethods H = new HelperMethods();
  1642.  
  1643.         #endregion
  1644.  
  1645.         #region Initialization
  1646.  
  1647.         public GreenUISeperator()
  1648.         {
  1649.             SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint |
  1650.             ControlStyles.ResizeRedraw | ControlStyles.UserPaint |
  1651.             ControlStyles.SupportsTransparentBackColor, true);
  1652.             DoubleBuffered = true;
  1653.             UpdateStyles();
  1654.             BackColor = Color.Transparent;
  1655.             ForeColor = H.GetHTMLColor("097A74");
  1656.         }
  1657.  
  1658.         #endregion
  1659.  
  1660.         #region Enumerators
  1661.  
  1662.         public enum Style
  1663.         {
  1664.             Horizental,
  1665.             Vertiacal
  1666.         };
  1667.  
  1668.         #endregion
  1669.  
  1670.         #region Properties
  1671.  
  1672.         public Style SepStyle
  1673.         {
  1674.             get
  1675.             {
  1676.                 return _SepStyle;
  1677.             }
  1678.             set
  1679.             {
  1680.                 _SepStyle = value;
  1681.                 if (value == Style.Horizental)
  1682.                 {
  1683.                     Height = 4;
  1684.                 }
  1685.                 else
  1686.                 {
  1687.                     Width = 4;
  1688.                 }
  1689.                 Invalidate();
  1690.             }
  1691.         }
  1692.  
  1693.         #endregion
  1694.  
  1695.         #region DrawControl
  1696.  
  1697.         protected override void OnPaint(PaintEventArgs e)
  1698.         {
  1699.             base.OnPaint(e);
  1700.             Bitmap B = new Bitmap(Width, Height);
  1701.             using (Graphics G = Graphics.FromImage(B))
  1702.             {
  1703.  
  1704.             G.SmoothingMode = SmoothingMode.AntiAlias;
  1705.             ColorBlend BL1 = new ColorBlend();
  1706.             BL1.Positions = new Single[] {0.0F, 0.15F, 0.85F, 1.0F};
  1707.             BL1.Colors = new Color[] { Color.Transparent, ForeColor, ForeColor, Color.Transparent };
  1708.             switch(SepStyle)
  1709.             {
  1710.                 case Style.Horizental:
  1711.                     using (LinearGradientBrush lb1 =new LinearGradientBrush(ClientRectangle, Color.Empty, Color.Empty, 0.0F))
  1712.                     {
  1713.                     lb1.InterpolationColors = BL1;
  1714.                     G.DrawLine(new Pen(lb1), 0, (int)0.7, Width, (int)0.7);
  1715.                     }
  1716.                     break;
  1717.                 case Style.Vertiacal:
  1718.                     using (LinearGradientBrush lb1 = new LinearGradientBrush(ClientRectangle, Color.Empty, Color.Empty, 90.0F))
  1719.                     {
  1720.                         lb1.InterpolationColors = BL1;
  1721.                         G.DrawLine(new Pen(lb1), (int)0.7, 0, (int)0.7, Height);
  1722.                     }
  1723.                     break;
  1724.             }
  1725.  
  1726.                 e.Graphics.DrawImage((Image)(B.Clone()), 0, 0);
  1727.                 G.Dispose();
  1728.                 B.Dispose();
  1729.             }
  1730.  
  1731.         }
  1732.  
  1733.         #endregion
  1734.                
  1735.     }
  1736.  
  1737. #endregion
  1738.  
  1739.     #region ComboBox
  1740.  
  1741.     public class GreenUIComboBox : ComboBox
  1742.     {
  1743.  
  1744.         #region Variables
  1745.  
  1746.         private int _StartIndex = 0;
  1747.         private static HelperMethods H = new HelperMethods();
  1748.  
  1749.         #endregion
  1750.  
  1751.         #region Constructors
  1752.  
  1753.         public GreenUIComboBox()
  1754.         {
  1755.             SetStyle(ControlStyles.AllPaintingInWmPaint |  ControlStyles.UserPaint |
  1756.                   ControlStyles.OptimizedDoubleBuffer | ControlStyles.SupportsTransparentBackColor, true);
  1757.             DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed;
  1758.             DoubleBuffered = true;
  1759.             StartIndex = 0;
  1760.             DropDownHeight = 100;
  1761.             BackColor = Color.Transparent;
  1762.             Font = new Font("Proxima Nova", 12, FontStyle.Regular);
  1763.             DropDownStyle = ComboBoxStyle.DropDownList;
  1764.             UpdateStyles();
  1765.  
  1766.         }
  1767.  
  1768.         #endregion
  1769.  
  1770.         #region Properties
  1771.  
  1772.         public int StartIndex
  1773.         {
  1774.             get
  1775.             {
  1776.                 return _StartIndex;
  1777.             }
  1778.             set
  1779.             {
  1780.                 _StartIndex = value;
  1781.                 try
  1782.                 {
  1783.                     base.SelectedIndex = value;
  1784.                 }
  1785.                 catch
  1786.                 {
  1787.  
  1788.                 }
  1789.                 Invalidate();
  1790.             }
  1791.         }
  1792.  
  1793.         #endregion
  1794.  
  1795.         #region Draw Control
  1796.  
  1797.         protected override void OnPaint(PaintEventArgs e)
  1798.         {
  1799.             Graphics G = e.Graphics;
  1800.  
  1801.                 Rectangle Rect = new Rectangle(0, 0, Width - 1, Height - 1);
  1802.  
  1803.                 G.SmoothingMode = SmoothingMode.AntiAlias;
  1804.                 G.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias;
  1805.  
  1806.                 H.FillRoundedPath(e.Graphics, Color.Silver, Rect, 8);
  1807.                 H.FillRoundedPath(e.Graphics, Color.Gainsboro, new Rectangle(Width - 28, 0, Width - 1, Height - 1), 10, false, true, false, true);
  1808.                 H.DrawRoundedPath(e.Graphics, Color.FromArgb(200, Color.DarkGray), 1, Rect, 8);
  1809.  
  1810.                 G.DrawLine(new Pen(Color.DarkGray, 1), new Point(Width - 21, (Height / 2) - Convert.ToInt32(4.5)), new Point(Width - 7, (Height / 2) - Convert.ToInt32(4.5)));
  1811.                 G.DrawLine(new Pen(Color.DarkGray, 1), new Point(Width - 21, (Height / 2) + Convert.ToInt32(0.5)), new Point(Width - 7, (Height / 2) + Convert.ToInt32(0.5)));
  1812.                 G.DrawLine(new Pen(Color.DarkGray, 1), new Point(Width - 21, (Height / 2) + Convert.ToInt32(3.5)), new Point(Width - 7, (Height / 2) + Convert.ToInt32(3.5)));
  1813.                 G.DrawLine(new Pen(Color.DarkGray, 1), new Point(Width - 28, 1), new Point(Width - 28, Height - 1));
  1814.                 G.DrawString(Text, Font, Brushes.Gray, new Rectangle(5, 1, Width - 1, Height - 1), new StringFormat { LineAlignment = StringAlignment.Center, Alignment = StringAlignment.Near });
  1815.  
  1816.         }
  1817.  
  1818.         protected override void OnDrawItem(DrawItemEventArgs e)
  1819.         {
  1820.             try
  1821.             {
  1822.                 e.Graphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.ClearTypeGridFit;
  1823.                 e.Graphics.FillRectangle(Brushes.Silver, e.Bounds);
  1824.                 Cursor = Cursors.Hand;
  1825.                 if (System.Convert.ToInt32((e.State & DrawItemState.Selected)) == (int)DrawItemState.Selected)
  1826.                 {
  1827.                     if (!(e.Index == -1))
  1828.                     {
  1829.                         e.Graphics.DrawString(GetItemText(Items[e.Index]), Font, H.SolidBrushHTMlColor("097A74"), new Rectangle(e.Bounds.X + 1, e.Bounds.Y + 3, e.Bounds.Width - 2, e.Bounds.Height - 2));
  1830.                     }
  1831.                 }
  1832.                 else
  1833.                 {
  1834.                     if (!(e.Index == -1))
  1835.                     {
  1836.                         e.Graphics.DrawString(GetItemText(Items[e.Index]), Font, Brushes.Gray, new Rectangle(e.Bounds.X + 1, e.Bounds.Y + 3, e.Bounds.Width - 2, e.Bounds.Height - 2));
  1837.                     }
  1838.                 }
  1839.  
  1840.             }
  1841.             catch
  1842.             {
  1843.  
  1844.             }
  1845.             Invalidate();
  1846.         }
  1847.  
  1848.         #endregion
  1849.  
  1850.         #region Events
  1851.  
  1852.         protected override void OnResize(EventArgs e)
  1853.         {
  1854.             base.OnResize(e);
  1855.             Invalidate();
  1856.         }
  1857.  
  1858.         protected override void OnCreateControl()
  1859.         {
  1860.             base.OnCreateControl();
  1861.  
  1862.         }
  1863.  
  1864.         protected override void OnLostFocus(EventArgs e)
  1865.         {
  1866.             base.OnLostFocus(e);
  1867.             SuspendLayout();
  1868.             Update();
  1869.             ResumeLayout();
  1870.         }
  1871.  
  1872.         #endregion
  1873.  
  1874.     }
  1875.  
  1876.     #endregion
  1877.  
  1878.     #region TabControl
  1879.  
  1880.     public class GreenUITabControl : TabControl
  1881.     {
  1882.  
  1883.         #region Variables
  1884.  
  1885.         private static HelperMethods H = new HelperMethods();
  1886.  
  1887.         #endregion
  1888.  
  1889.         #region Draw Control
  1890.  
  1891.         protected override void OnPaint(PaintEventArgs e)
  1892.         {
  1893.  
  1894.             Graphics G = e.Graphics;
  1895.  
  1896.             Cursor = Cursors.Hand;
  1897.  
  1898.             G.Clear(Color.Gainsboro);
  1899.             Cursor = Cursors.Hand;
  1900.  
  1901.             G.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias;
  1902.  
  1903.             G.FillRectangle(Brushes.Silver, new Rectangle(0, 0, Width, ItemSize.Height + 2));
  1904.             G.DrawRectangle(new Pen(Color.FromArgb(200, Color.DarkGray), 1), new Rectangle(0, 0, Width - 1, Height - 1));
  1905.             G.DrawLine(new Pen(Color.FromArgb(200, Color.DarkGray), 1), new Point(1, ItemSize.Height + 2), new Point(Width - 1, ItemSize.Height + 2));
  1906.  
  1907.             for (int i = 0; i <= TabCount - 1; i++)
  1908.             {
  1909.                Rectangle R = GetTabRect(i);
  1910.                 if (i == SelectedIndex)
  1911.                 {
  1912.                     G.DrawString(TabPages[i].Text,Font, H.SolidBrushHTMlColor("097A74"), R.X + 35, R.Y + 15, new StringFormat() { Alignment = StringAlignment.Center });
  1913.                 }
  1914.                 else
  1915.                 {
  1916.                     G.DrawString(TabPages[i].Text, Font, Brushes.DarkGray, R.X + 35, R.Y + 15, new StringFormat() {Alignment = StringAlignment.Center});
  1917.                 }
  1918.              }
  1919.  
  1920.         }
  1921.  
  1922.         #endregion
  1923.  
  1924.         #region Constructors
  1925.  
  1926.         public GreenUITabControl()
  1927.         {
  1928.             SetStyle(ControlStyles.UserPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint | ControlStyles.SupportsTransparentBackColor, true);
  1929.             DoubleBuffered = true;
  1930.             Alignment = TabAlignment.Top;
  1931.             SizeMode = TabSizeMode.Fixed;
  1932.             ItemSize = new Size(80, 45);
  1933.             Dock = DockStyle.None;
  1934.             Font = new Font("Proxima Nova Rg", 10, FontStyle.Bold);
  1935.             UpdateStyles();
  1936.  
  1937.         }
  1938.  
  1939.         #endregion
  1940.  
  1941.         #region Events
  1942.  
  1943.         protected override void OnCreateControl()
  1944.         {
  1945.             base.OnCreateControl();
  1946.             foreach (TabPage Tab in base.TabPages)
  1947.             {
  1948.                 Tab.BackColor = Color.Gainsboro;
  1949.             }
  1950.         }
  1951.  
  1952.         #endregion
  1953.  
  1954.     }
  1955.  
  1956.     #endregion
Add Comment
Please, Sign In to add comment