/// <summary>
 /// Initializes a new instance of the <see cref="ZeroitMetroTrackbar" /> class.
 /// </summary>
 public ZeroitMetroTrackbar()
 {
     this._Style         = Design.Style.Light;
     this._IsScrolling   = 0;
     this._SndSliderPos  = 10;
     this._SliderPos     = 0;
     this._SliderStyle   = ZeroitMetroTrackbar.MetroSliderStyle.Rectangular;
     this._SingleSlider  = true;
     this._Value         = 50;
     this._SecondValue   = 30;
     this._RailWidth     = 5;
     this._SliderWidth   = 10;
     this._UseGradient   = true;
     this._Maximum       = 100;
     this._Minimum       = 0;
     this._LeftColor     = Design.MetroColors.AccentBlue;
     this._RightColor    = Design.MetroColors.LightSwitchRail;
     this._SliderColor   = Design.MetroColors.LightDefault;
     this._BorderColor   = Design.MetroColors.LightBorder;
     this._HoverColor    = Design.MetroColors.AccentLightBlue;
     this._RegionColor   = Design.MetroColors.AccentLightBlue;
     this._GradientColor = Design.MetroColors.ChangeColorBrightness(this._LeftColor, -0.2f);
     this._RoundingArc   = 5;
     this._MouseState    = Helpers.MouseState.None;
     this._AutoStyle     = true;
     this.Font           = new System.Drawing.Font("Segoe UI", 9f);
     this.SetStyle(ControlStyles.UserPaint | ControlStyles.ResizeRedraw | ControlStyles.SupportsTransparentBackColor | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer, true);
     this.UpdateStyles();
     this.BackColor = Color.Transparent;
 }
Пример #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ZeroitMetroForm" /> class.
        /// </summary>
        public ZeroitMetroForm()
        {
            this._AccentColor             = Color.FromArgb(0, 122, 204);
            this._DrawBorders             = true;
            this._AllowResize             = true;
            this._State                   = ZeroitMetroForm.FormState.Normal;
            this._Style                   = Design.Style.Light;
            this._ResizeBorderWidth       = 6;
            this._TextRectangle           = new Rectangle(32, 7, checked (this.Width - 1), checked (this.Height - 1));
            this._resizeDir               = ZeroitMetroForm.ResizeDirection.None;
            this._HideBorderWhenMaximized = true;
            this._AlignTextToControlBox   = true;
            this._MainControlBox          = null;
            this._IsActive                = false;
            this._UseGradientBackColor    = false;
            Point point  = new Point(0, 0);
            Point point1 = new Point(this.Width, this.Height);

            this._GradientBrush   = new LinearGradientBrush(point, point1, Color.FromArgb(184, 43, 86), Color.FromArgb(94, 59, 149));
            this._FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
            this.FormBorderStyle  = System.Windows.Forms.FormBorderStyle.None;
            this.BackColor        = Color.White;
            this.ForeColor        = Color.Black;
            this.Font             = new System.Drawing.Font("Segoe UI", 9f);
            this.SetStyle(ControlStyles.UserPaint | ControlStyles.ResizeRedraw | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer, true);
            this.UpdateStyles();
        }
Пример #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ZeroitMetroTracker" /> class.
        /// </summary>
        public ZeroitMetroTracker()
        {
            this._paths            = new MetroTrackerPathCollection();
            this._pens             = new Dictionary <MetroTrackerPath, Pen>();
            this._brushes          = new Dictionary <MetroTrackerPath, Brush>();
            this._nameBrushes      = new Dictionary <MetroTrackerPath, Brush>();
            this._BorderColor      = Design.MetroColors.LightBorder;
            this._GridColor        = Design.MetroColors.PopUpBorder;
            this._Style            = Design.Style.Light;
            this._GridStyle        = Design.GridStyle.Crossed;
            this._GridSize         = 10;
            this._ShowPathNames    = true;
            this._ShowCustomValue  = true;
            this._ShowedValueCount = 1000;
            this._AutoStyle        = true;
            this.SetStyle(ControlStyles.UserPaint | ControlStyles.ResizeRedraw | ControlStyles.SupportsTransparentBackColor | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer, true);
            this.UpdateStyles();
            this.BackColor = Color.White;
            this._paths    = new MetroTrackerPathCollection();
            ZeroitMetroTracker metroTracker = this;

            this.Paths.ItemAdded += new EventHandler <MetroTrackerPathCollectionEventArgs>(metroTracker.Paths_Added);
            ZeroitMetroTracker metroTracker1 = this;

            this.Paths.ItemRemoving += new EventHandler <MetroTrackerPathCollectionEventArgs>(metroTracker1.Paths_Removing);
            this._pens        = new Dictionary <MetroTrackerPath, Pen>();
            this._brushes     = new Dictionary <MetroTrackerPath, Brush>();
            this._nameBrushes = new Dictionary <MetroTrackerPath, Brush>();
        }
Пример #4
0
        /// <summary>
        /// Raises the <see cref="E:System.Windows.Forms.Control.BackColorChanged" /> event.
        /// </summary>
        /// <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param>
        protected override void OnBackColorChanged(EventArgs e)
        {
            if (this.FindForm() is ZeroitMetroForm)
            {
                if (this._AutoStyle)
                {
                    ZeroitMetroForm metroForm = (ZeroitMetroForm)this.FindForm();
                    this.Style  = metroForm.Style;
                    this._Style = metroForm.Style;
                    this.Invalidate();
                }
            }
            else if (this._AutoStyle)
            {
                //Color backColor = this.Parent.BackColor;

                Color backColor = BackColor;

                if (backColor == Color.White)
                {
                    this._Style = Design.Style.Light;
                }
                else if (backColor == Color.FromArgb(40, 40, 40))
                {
                    this._Style = Design.Style.Dark;
                }
                this.Style = this._Style;
                this.Invalidate();
            }
            base.OnBackColorChanged(e);
        }
Пример #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ZeroitMetroPanelCategory" /> class.
 /// </summary>
 public ZeroitMetroPanelCategory()
 {
     this._Style             = Design.Style.Light;
     this._DefaultColor      = Design.MetroColors.LightDefault;
     this._BorderColor       = Design.MetroColors.LightBorder;
     this._AccentColor       = Design.MetroColors.AccentBlue;
     this._GradientColor     = this._DefaultColor;
     this._LineGradientColor = Design.MetroColors.ChangeColorBrightness(this._AccentColor, -0.2f);
     this._LineOrientation   = Orientation.Vertical;
     this._LineThickness     = 2;
     this._UseGradient       = false;
     this._UseGradientOnLine = true;
     this._TextAlign         = StringAlignment.Center;
     this._LineAlign         = StringAlignment.Center;
     this._Appearance        = ZeroitMetroPanelCategory.PanelAppearance.Category;
     this._SlopeA            = 15;
     this._SlopeB            = 0;
     this._RoundingArc       = 15;
     this._AllowFormMoving   = false;
     this._GradientPointA    = new Point(0, 0);
     this._GradientPointB    = new Point(this.Width, this.Height);
     this._AutoStyle         = true;
     this.Font = new System.Drawing.Font("Segoe UI", 9f);
     this.SetStyle(ControlStyles.UserPaint | ControlStyles.ResizeRedraw | ControlStyles.SupportsTransparentBackColor | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer, true);
     DoubleBuffered = true;
     this.BackColor = Color.Transparent;
     this.UpdateStyles();
 }
Пример #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ZeroitMetroSeparator" /> class.
 /// </summary>
 public ZeroitMetroSeparator()
 {
     this._Style       = Design.Style.Light;
     this._Orientation = Design.Orientation.Horizontal;
     this.ColorScheme  = new ZeroitMetroSeparator.MainColorScheme();
     this.Height       = 2;
     this._Style       = Design.Style.Light;
 }
Пример #7
0
 /// <summary>
 /// Raises the <see cref="E:System.Windows.Forms.Control.BackColorChanged" /> event.
 /// </summary>
 /// <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param>
 protected override void OnBackColorChanged(EventArgs e)
 {
     if (this.FindForm() is ZeroitMetroForm)
     {
         if (this._AutoStyle)
         {
             this.Style = ((ZeroitMetroForm)this.FindForm()).Style;
             this.Invalidate();
         }
     }
     base.OnBackColorChanged(e);
 }
Пример #8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ZeroitMetroListbox" /> class.
 /// </summary>
 public ZeroitMetroListbox()
 {
     this._SelectionColor = Design.MetroColors.AccentBlue;
     this._BorderColor    = Design.MetroColors.LightBorder;
     this._Style          = Design.Style.Light;
     this._AutoStyle      = true;
     this.Font            = new System.Drawing.Font("Segoe UI", 8f);
     this.DoubleBuffered  = true;
     this.BackColor       = Design.MetroColors.LightDefault;
     this.ForeColor       = Design.MetroColors.LightFont;
     this.BorderStyle     = System.Windows.Forms.BorderStyle.None;
 }
            /// <summary>
            /// Gets the color of the correct fore.
            /// </summary>
            /// <param name="style">The style.</param>
            /// <param name="defaultColor">The default color.</param>
            /// <param name="isEnabled">if set to <c>true</c> [is enabled].</param>
            /// <returns>Color.</returns>
            public static Color GetCorrectForeColor(Design.Style style, Color defaultColor, bool isEnabled = true)
            {
                Color color = defaultColor;

                if (style == Design.Style.Light)
                {
                    color = (isEnabled ? Design.MetroColors.LightFont : Design.MetroColors.LightDisabledFont);
                }
                else if (style == Design.Style.Dark)
                {
                    color = (isEnabled ? Design.MetroColors.DarkFont : Design.MetroColors.DarkDisabledFont);
                }
                return(color);
            }
Пример #10
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MetroControlBoxArea"/> class.
        /// </summary>
        /// <param name="img">The img.</param>
        /// <param name="size">The size.</param>
        /// <param name="defaultcolor">The defaultcolor.</param>
        /// <param name="hovercolor">The hovercolor.</param>
        /// <param name="pressedcolor">The pressedcolor.</param>
        /// <param name="areatype">The areatype.</param>
        /// <param name="name">The name.</param>
        /// <param name="highlightarea">if set to <c>true</c> [highlightarea].</param>
        public MetroControlBoxArea(Image img, Size size, Color defaultcolor, Color hovercolor, Color pressedcolor, MetroControlBoxArea.ControlBoxAreaType areatype = 0, string name = "", bool highlightarea = false)
        {
            Size  size1 = new Size();
            Color color = new Color();

            MetroControlBoxArea.__ENCAddToList(this);
            this._AreaImage       = null;
            this._AreaSize        = new Size(32, 32);
            this._DefaultColor    = Color.White;
            this._HoverColor      = Color.FromArgb(240, 240, 240);
            this._PressedColor    = Color.FromArgb(0, 122, 204);
            this._IconColor       = Color.Black;
            this._AreaType        = MetroControlBoxArea.ControlBoxAreaType.Custom;
            this._Name            = string.Empty;
            this._HighlightColor  = Color.FromArgb(0, 122, 204);
            this._IsHighlighted   = false;
            this._Enabled         = true;
            this._InvertIconColor = false;
            this._Style           = Design.Style.Light;
            if (img != null)
            {
                this._AreaImage = img;
            }
            if (size != size1)
            {
                this._AreaSize = size;
            }
            if (defaultcolor != color)
            {
                this._DefaultColor = defaultcolor;
            }
            if (hovercolor != color)
            {
                this._HoverColor = hovercolor;
            }
            if (this._PressedColor != color)
            {
                this._PressedColor = pressedcolor;
            }
            this._IsHighlighted  = highlightarea;
            this._HighlightColor = this._PressedColor;
            this._AreaType       = areatype;
            this._Name           = name;
            PropertyChangedEventHandler propertyChangedEventHandler = this.PropertyChanged;

            if (propertyChangedEventHandler != null)
            {
                propertyChangedEventHandler(this, new PropertyChangedEventArgs("Items"));
            }
        }
        /**/
        #endregion


        #region Constructor
        /// <summary>
        /// Initializes a new instance of the <see cref="ZeroitMetroCheckBox" /> class.
        /// </summary>
        public ZeroitMetroCheckBox()
        {
            this.rect                  = new Rectangle(0, 0, 16, 16);
            this.CurrentState          = ZeroitMetroCheckBox.MouseState.None;
            this._Text                 = this.Name;
            this._Style                = Design.Style.Light;
            this._DrawBorders          = true;
            this._Checked              = true;
            this._CheckOnClick         = true;
            this._UseFullDetectionArea = false;
            this.ColorScheme           = new ZeroitMetroCheckBox.MainColorScheme();
            this.Size                  = new System.Drawing.Size(115, 18);
            this.SetStyle(ControlStyles.UserPaint | ControlStyles.ResizeRedraw | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer, true);
            this.UpdateStyles();
            this.FixBug();
        }
Пример #12
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ZeroitMetroCircularProgress" /> class.
 /// </summary>
 public ZeroitMetroCircularProgress()
 {
     this._InnerCircleSize      = 80;
     this._Style                = Design.Style.Light;
     this._Value                = 50;
     this._Thickness            = 10;
     this._DrawInnerCircle      = true;
     this._DrawOutlines         = false;
     this._DrawPercentage       = true;
     this._DrawPercentageSymbol = true;
     this._PercentageSymbol     = "%";
     this.ColorScheme           = new ZeroitMetroCircularProgress.MainColorScheme();
     this.Size      = new System.Drawing.Size(128, 128);
     this.ForeColor = Color.White;
     this.Font      = new System.Drawing.Font("Segoe UI Light", 15f);
     this.SetStyle(ControlStyles.UserPaint | ControlStyles.ResizeRedraw | ControlStyles.SupportsTransparentBackColor | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer, true);
     this.UpdateStyles();
 }
Пример #13
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MetroControlBoxArea"/> class.
        /// </summary>
        /// <param name="areatype">The areatype.</param>
        /// <param name="style">The style.</param>
        /// <param name="name">The name.</param>
        /// <param name="highlightarea">if set to <c>true</c> [highlightarea].</param>
        public MetroControlBoxArea(MetroControlBoxArea.ControlBoxAreaType areatype, Design.Style style, string name = "", bool highlightarea = false)
        {
            MetroControlBoxArea.__ENCAddToList(this);
            this._AreaImage       = null;
            this._AreaSize        = new Size(32, 32);
            this._DefaultColor    = Color.White;
            this._HoverColor      = Color.FromArgb(240, 240, 240);
            this._PressedColor    = Color.FromArgb(0, 122, 204);
            this._IconColor       = Color.Black;
            this._AreaType        = MetroControlBoxArea.ControlBoxAreaType.Custom;
            this._Name            = string.Empty;
            this._HighlightColor  = Color.FromArgb(0, 122, 204);
            this._IsHighlighted   = false;
            this._Enabled         = true;
            this._InvertIconColor = false;
            this._Style           = Design.Style.Light;
            if (style == Design.Style.Light)
            {
                this._DefaultColor = Design.MetroColors.LightDefault;
                this._HoverColor   = Design.MetroColors.LightHover;
                this._PressedColor = Design.MetroColors.AccentBlue;
                this._IconColor    = Design.MetroColors.LightIcon;
            }
            else if (style == Design.Style.Dark)
            {
                this._DefaultColor = Design.MetroColors.DarkDefault;
                this._HoverColor   = Design.MetroColors.DarkHover;
                this._PressedColor = Design.MetroColors.AccentBlue;
                this._IconColor    = Design.MetroColors.LightHover;
            }
            this._HighlightColor = this._PressedColor;
            this._IsHighlighted  = highlightarea;
            this._Name           = name;
            this._AreaType       = areatype;
            PropertyChangedEventHandler propertyChangedEventHandler = this.PropertyChanged;

            if (propertyChangedEventHandler != null)
            {
                propertyChangedEventHandler(this, new PropertyChangedEventArgs("Items"));
            }
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="ZeroitMetroNavigationButton" /> class.
        /// </summary>
        public ZeroitMetroNavigationButton()
        {
            this._Style              = Design.Style.Light;
            this._ArrowDirection     = System.Windows.Forms.ArrowDirection.Left;
            this._ArrowPath          = null;
            this._CircleRect         = new RectangleF();
            this._BorderColor        = Design.MetroColors.LightBorder;
            this._BorderHoverColor   = Design.MetroColors.AccentBlue;
            this._BorderPressedColor = Design.MetroColors.AccentBlue;
            this._DefaultColor       = Design.MetroColors.LightDefault;
            this._HoverColor         = Design.MetroColors.LightHover;
            this._PressedColor       = Design.MetroColors.AccentBlue;
            this._ArrowColor         = Design.MetroColors.LightBorder;
            this._ArrowHoverColor    = Design.MetroColors.AccentBlue;
            this._ArrowPressedColor  = Design.MetroColors.LightDefault;
            this._DisabledColor      = Design.MetroColors.LightDisabled;
            this._DisabledArrowColor = Design.MetroColors.DisabledBorder;
            this._MouseState         = Helpers.MouseState.None;
            this._AutoStyle          = true;
            this.Font = new System.Drawing.Font("Segoe UI", 9f);
            this.SetStyle(ControlStyles.UserPaint | ControlStyles.ResizeRedraw | ControlStyles.SupportsTransparentBackColor | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer, true);
            this.UpdateStyles();
            this.BackColor   = Color.Transparent;
            this.Size        = new System.Drawing.Size(24, 24);
            this._CircleRect = new RectangleF(2.5f, 2.5f, 18f, 18f);
            this._ArrowPath  = new GraphicsPath(FillMode.Alternate);
            PointF       pointF       = new PointF(7.5f, 11.5f);
            GraphicsPath graphicsPath = this._ArrowPath;
            PointF       pointF1      = new PointF(11.5f, 15.5f);

            graphicsPath.AddLine(pointF1, pointF);
            GraphicsPath graphicsPath1 = this._ArrowPath;

            pointF1 = new PointF(11.5f, 7.5f);
            graphicsPath1.AddLine(pointF, pointF1);
            this._ArrowPath.StartFigure();
            GraphicsPath graphicsPath2 = this._ArrowPath;

            pointF1 = new PointF(16.5f, 11.5f);
            graphicsPath2.AddLine(pointF, pointF1);
        }
Пример #15
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ZeroitMetroProgressbar" /> class.
 /// </summary>
 public ZeroitMetroProgressbar()
 {
     this._Style           = Design.Style.Light;
     this._Orientation     = System.Windows.Forms.Orientation.Horizontal;
     this._Value           = 50;
     this._Maximum         = 100;
     this._ProgressColor   = Design.MetroColors.AccentBlue;
     this._DefaultColor    = Design.MetroColors.LightDefault;
     this._BorderColor     = Design.MetroColors.LightBorder;
     this._gradientColor   = Design.MetroColors.ChangeColorBrightness(this._ProgressColor, -0.2f);
     this._DrawBorder      = true;
     this._ShowValueAsText = false;
     this._UseGradient     = true;
     this._SpecialSymbol   = "%";
     this._IsRound         = false;
     this._RoundingArc     = this.Height;
     this._AutoStyle       = true;
     this.Size             = new System.Drawing.Size(200, 25);
     this.SetStyle(ControlStyles.UserPaint | ControlStyles.ResizeRedraw | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer, true);
     this.UpdateStyles();
 }
        /**/
        #endregion

        /// <summary>
        /// Initializes a new instance of the <see cref="ZeroitMetroChecker" /> class.
        /// </summary>
        public ZeroitMetroChecker()
        {
            //ZeroitMetroChecker.__ENCAddToList(this);
            this._DefaultColor       = Design.MetroColors.LightHover;
            this._HoverColor         = Design.MetroColors.LightDarkDefault;
            this._PressedColor       = Design.MetroColors.AccentDarkBlue;
            this._CheckColor         = Design.MetroColors.AccentBlue;
            this._CheckedBorderColor = Design.MetroColors.LightBorder;
            //this._Checked = false;
            this._CheckerWidth  = 13;
            this._BoundsWidth   = 16;
            this._CheckerSymbol = ZeroitMetroChecker.MetroCheckerSymbol.Box;
            this._Style         = Design.Style.Light;
            this._AutoStyle     = true;
            this._MouseState    = Helpers.MouseState.None;
            this.Font           = new System.Drawing.Font("Segoe UI", 9f);
            this.Size           = new System.Drawing.Size(this.GetMaxWidth(), 14);
            this.SetStyle(ControlStyles.UserPaint | ControlStyles.ResizeRedraw | ControlStyles.SupportsTransparentBackColor | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer, true);
            this.BackColor = Color.Transparent;
            this.UpdateStyles();
        }
Пример #17
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ZeroitMetroGraph" /> class.
 /// </summary>
 public ZeroitMetroGraph()
 {
     this._Style                = Design.Style.Light;
     this._DefaultColor         = Design.MetroColors.LightDefault;
     this._GridColor            = Design.MetroColors.PopUpBorder;
     this._SingleLineColor      = Design.MetroColors.AccentBlue;
     this._ClassicLineColor     = Design.MetroColors.AccentBlue;
     this._ClassicFillColor     = Color.FromArgb(50, Design.MetroColors.AccentBlue);
     this._GradientColor        = Color.FromArgb(50, Design.MetroColors.ChangeColorBrightness(Design.MetroColors.AccentBlue, -0.2f));
     this._HoverColor           = Design.MetroColors.AccentLightBlue;
     this._HoverBoxColor        = Design.MetroColors.LightDefault;
     this._HoverBoxBorderColor  = Design.MetroColors.PopUpBorder;
     this._BorderColor          = Design.MetroColors.LightBorder;
     this._DrawHoverLine        = true;
     this._DrawHoverData        = true;
     this._ClassicLineThickness = 2;
     this._UseGradient          = true;
     this._DashStyle            = System.Drawing.Drawing2D.DashStyle.Solid;
     this._DrawVerticalLines    = false;
     this._DrawHorizontalLines  = true;
     this._SingleLine           = false;
     this._SingleLineThickness  = 5;
     this._SingleLineShadow     = true;
     this._SidePadding          = false;
     this._OverrideMinimum      = false;
     this._OverrideMaximum      = false;
     this._OverriddenMinimum    = 0;
     this._OverriddenMaximum    = 100;
     this._Minimum              = float.MinValue;
     this._Maximum              = float.MaxValue;
     this._Index                = -1;
     this._GradientPointA       = new Point(checked ((int)Math.Round((double)this.Width / 2)), 0);
     this._GradientPointB       = new Point(checked ((int)Math.Round((double)this.Width / 2)), this.Height);
     this._AutoStyle            = true;
     this.Font = new System.Drawing.Font("Segoe UI", 9f);
     this.SetStyle(ControlStyles.UserPaint | ControlStyles.ResizeRedraw | ControlStyles.SupportsTransparentBackColor | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer, true);
     this.UpdateStyles();
     this._Values       = new List <float>();
     this._SmoothValues = new List <float>();
 }
        } /**/
        #endregion


        /// <summary>
        /// Initializes a new instance of the <see cref="ZeroitMetroButton" /> class.
        /// </summary>
        public ZeroitMetroButton()
        {
            this._DefaultColor    = Design.MetroColors.LightDefault;
            this._HoverColor      = Design.MetroColors.LightDefault;
            this._PressedColor    = Design.MetroColors.AccentBlue;
            this._BorderColor     = Design.MetroColors.LightBorder;
            this._DrawBorders     = true;
            this._Style           = Design.Style.Light;
            this._DisabledColor   = Design.MetroColors.LightDisabled;
            this._alignment       = StringAlignment.Center;
            this._DialogResult    = System.Windows.Forms.DialogResult.None;
            this._Image           = null;
            this._IsRound         = false;
            this._RoundingArc     = 23;
            this._InvertForeColor = false;
            this._AutoStyle       = true;
            this._MouseState      = Helpers.MouseState.None;
            this.Font             = new System.Drawing.Font("Segoe UI", 9f);
            this.SetStyle(ControlStyles.UserPaint | ControlStyles.ResizeRedraw | ControlStyles.SupportsTransparentBackColor | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer, true);
            this.BackColor = Color.Transparent;
            this.UpdateStyles();
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="ZeroitMetroSwitch" /> class.
 /// </summary>
 public ZeroitMetroSwitch()
 {
     this._Style        = Design.Style.Light;
     this._Checked      = false;
     this._DefaultColor = Design.MetroColors.LightSwitchRail;
     this._BorderColor  = Design.MetroColors.LightBorder;
     this._CheckColor   = Design.MetroColors.AccentBlue;
     this._SwitchColor  = Design.MetroColors.LightDefault;
     this._HoverColor   = Design.MetroColors.AccentLightBlue;
     this._SwitchStyle  = ZeroitMetroSwitch.MetroSwitchStyle.Round;
     this._SwitchWidth  = 15;
     this._RailWidth    = 10;
     this._OnOffText    = "OFF|ON";
     this._OnText       = "ON";
     this._OffText      = "OFF";
     this._AutoStyle    = true;
     this._MouseState   = Helpers.MouseState.None;
     this.Font          = new System.Drawing.Font("Segoe UI", 9f);
     this.SetStyle(ControlStyles.UserPaint | ControlStyles.ResizeRedraw | ControlStyles.SupportsTransparentBackColor | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer, true);
     this.UpdateStyles();
     this.BackColor = Color.Transparent;
 }
 /// <summary>
 /// Creates the default areas.
 /// </summary>
 private void CreateDefaultAreas()
 {
     this._IsReady = true;
     MetroControlBoxArea[] metroControlBoxArea = new MetroControlBoxArea[3];
     Design.Style          style = Design.Style.Light;
     if (this.Parent is ZeroitMetroForm)
     {
         if (((ZeroitMetroForm)this.Parent).Style == Design.Style.Dark)
         {
             style = Design.Style.Dark;
         }
     }
     else if (this.Parent.BackColor == Color.FromArgb(40, 40, 40))
     {
         style = Design.Style.Dark;
     }
     metroControlBoxArea[0] = new MetroControlBoxArea(MetroControlBoxArea.ControlBoxAreaType.Minimize, style, "defminimize", false);
     metroControlBoxArea[1] = new MetroControlBoxArea(MetroControlBoxArea.ControlBoxAreaType.Maximize, style, "defmaximize", false);
     metroControlBoxArea[2] = new MetroControlBoxArea(MetroControlBoxArea.ControlBoxAreaType.Close, style, "defclose", false);
     this.Areas.AddItems(metroControlBoxArea);
     this.Invalidate();
     this.Size = new System.Drawing.Size(96, 32);
 }
Пример #21
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ZeroitMetroTask" /> class.
        /// </summary>
        public ZeroitMetroTask()
        {
            //this._PointCollection = new MetroTaskPointCollection();
            this._FinishedColor   = Design.MetroColors.TaskColor;
            this._LineColor       = Design.MetroColors.TaskColor;
            this._HoverColor      = Design.MetroColors.AccentLightBlue;
            this._StartPointWidth = 10;
            this._Style           = Design.Style.Light;
            this._PointPosition   = new List <Rectangle>();
            this._TextRectangles  = new List <Rectangle>();
            this._HotIndex        = -1;
            this._AutoStyle       = true;
            this.Font             = new System.Drawing.Font("Segoe UI", 9f);
            this.SetStyle(ControlStyles.UserPaint | ControlStyles.ResizeRedraw | ControlStyles.SupportsTransparentBackColor | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer, true);
            this.UpdateStyles();

            ZeroitMetroTask metroTask = this;

            this._PointCollection.ItemAdded += new EventHandler <MetroTaskPointCollectionEventArgs>(metroTask.Point_Added);
            ZeroitMetroTask metroTask1 = this;

            this._PointCollection.ItemRemoving += new EventHandler <MetroTaskPointCollectionEventArgs>(metroTask1.Point_Removed);
            Refresh();
        }
Пример #22
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ZeroitMetroTrackbarRegion"/> class.
        /// </summary>
        public ZeroitMetroTrackbarRegion()
        {
            ZeroitMetroTrackbarRegion metroTrackbarRegion = this;

            base.MouseDown += new MouseEventHandler(metroTrackbarRegion.MetroTrackBarRegion_MouseDown);
            ZeroitMetroTrackbarRegion metroTrackbarRegion1 = this;

            base.MouseMove += new MouseEventHandler(metroTrackbarRegion1.MetroTrackBarRegion_MouseMove);
            ZeroitMetroTrackbarRegion metroTrackbarRegion2 = this;

            base.MouseUp += new MouseEventHandler(metroTrackbarRegion2.MetroTrackBarRegion_MouseUp);
            ZeroitMetroTrackbarRegion metroTrackbarRegion3 = this;

            base.Paint += new PaintEventHandler(metroTrackbarRegion3.MetroTrackBarRegion_Paint);
            ZeroitMetroTrackbarRegion.__ENCAddToList(this);
            this.BarSize           = 6;
            this.sliderWidth       = 6;
            this._UseSwitchBorders = true;
            this._UseFixedSize     = true;
            this._Style            = Design.Style.Light;
            this.ColorScheme       = new ZeroitMetroTrackbarRegion.MainColorScheme();
            this.val        = 50;
            this.minVal     = 0;
            this.maxVal     = 100;
            this.scrolling1 = false;
            this.scrolling2 = false;
            this.slider1Pos = 0;
            this.slider2Pos = 0;
            this.SetStyle(ControlStyles.UserPaint | ControlStyles.ResizeRedraw | ControlStyles.SupportsTransparentBackColor | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer, true);
            this.UpdateStyles();
            this.Size   = new System.Drawing.Size(200, 20);
            this._Style = Design.Style.Dark;
            this.Invalidate();
            this._Style = Design.Style.Light;
            this.SetPos();
        }
Пример #23
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ZeroitMetroKnob" /> class.
        /// </summary>
        public ZeroitMetroKnob()
        {
            this.percentage      = 50f;
            this.baseAngle       = 90f;
            this.blockAngle      = 90f;
            this.lineEnd         = 90;
            this._Minimum        = 0;
            this._Maximum        = 100;
            this._Value          = 50;
            this._LineLength     = 18;
            this._LineWidth      = 1;
            this._KnobStyle      = ZeroitMetroKnob.KnobStyles.Circle;
            this._FillMode       = ZeroitMetroKnob.KnobFillModes.Solid;
            this._HatchStyle     = System.Drawing.Drawing2D.HatchStyle.BackwardDiagonal;
            this._DrawLineShadow = true;
            this._Style          = Design.Style.Light;
            this._BorderColor    = Design.MetroColors.LightBorder;
            this._LineColor      = Design.MetroColors.LightBorder;
            this._AccentColor    = Design.MetroColors.AccentBlue;
            this._FillColor      = Design.MetroColors.AccentBlue;
            this._GradientColor  = Design.MetroColors.LightDefault;
            this._DefaultColor   = Design.MetroColors.LightDefault;
            this._AutoStyle      = true;
            this._MouseState     = Helpers.MouseState.None;
            this.Font            = new System.Drawing.Font("Segoe UI", 9f);

            this.SetStyle(
                ControlStyles.UserPaint |
                ControlStyles.ResizeRedraw |
                ControlStyles.SupportsTransparentBackColor |
                ControlStyles.AllPaintingInWmPaint |
                ControlStyles.OptimizedDoubleBuffer, true);

            //this.BackColor = this.FindForm().BackColor;
            this.UpdateStyles();
        }
Пример #24
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MetroFormEventArgs"/> class.
 /// </summary>
 /// <param name="style">The style.</param>
 public MetroFormEventArgs(Design.Style style)
 {
     this._style = style;
 }