THE_LORD

Acacia Theme

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