yangyin
2025-03-27 b0de14c2670b9ff0079dacfb4b7457b438368f11
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
#region Imports
 
using DPumpHydr.WinFrmUI.RLT.Design.Metro;
using DPumpHydr.WinFrmUI.RLT.Enum.Metro;
using DPumpHydr.WinFrmUI.RLT.Extension.Metro;
using DPumpHydr.WinFrmUI.RLT.Interface.Metro;
using DPumpHydr.WinFrmUI.RLT.Manager;
using System;
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Text;
using System.Runtime.InteropServices;
using System.Windows.Forms;
 
#endregion
 
namespace DPumpHydr.WinFrmUI.RLT.Controls
{
    #region MetroRichTextBox
 
    [ToolboxItem(true)]
    [ToolboxBitmap(typeof(MetroRichTextBox), "Bitmaps.RichTextBox.bmp")]
    [Designer(typeof(MetroRichTextBoxDesigner))]
    [DefaultProperty("Text")]
    [DefaultEvent("TextChanged")]
    [ComVisible(true)]
    public class MetroRichTextBox : Control, IMetroControl
    {
        #region Interfaces
 
        [Category("Metro"), Description("Gets or sets the style associated with the control.")]
        public Style Style
        {
            get => StyleManager?.Style ?? _style;
            set
            {
                _style = value;
                switch (value)
                {
                    case Style.Light:
                        ApplyTheme();
                        break;
                    case Style.Dark:
                        ApplyTheme(Style.Dark);
                        break;
                    case Style.Custom:
                        ApplyTheme(Style.Custom);
                        break;
                    default:
                        ApplyTheme();
                        break;
                }
                Invalidate();
            }
        }
 
        [Category("Metro"), Description("Gets or sets the Style Manager associated with the control.")]
        public MetroStyleManager StyleManager
        {
            get => _styleManager;
            set { _styleManager = value; Invalidate(); }
        }
 
        [Category("Metro"), Description("Gets or sets the The Author name associated with the theme.")]
        public string ThemeAuthor { get; set; }
 
        [Category("Metro"), Description("Gets or sets the The Theme name associated with the theme.")]
        public string ThemeName { get; set; }
 
        #endregion Interfaces
 
        #region Global Vars
 
        private Utilites _utl;
 
        #endregion Global Vars
 
        #region Internal Vars
 
        private Style _style;
        private MetroStyleManager _styleManager;
        private int _maxLength;
        private bool _readOnly;
        private MouseMode _state;
        private bool _wordWrap;
        private bool _autoWordSelection;
        private string[] _lines;
        private Color _foreColor;
        private Color _backColor;
        private Color _borderColor;
        private Color _hoverColor;
 
        private bool _isDerivedStyle = true;
        private Color _disabledBackColor = Color.FromArgb(204, 204, 204);
        private Color _disabledForeColor = Color.FromArgb(136, 136, 136);
        private Color _disabledBorderColor = Color.FromArgb(155, 155, 155);
 
        #region Base RichTextBox
 
        private readonly RichTextBox _richTextBox = new();
 
        #endregion Base RichTextBox
 
        #endregion Internal Vars
 
        #region Constructors
 
        public MetroRichTextBox()
        {
            SetStyle
            (
                ControlStyles.AllPaintingInWmPaint |
                ControlStyles.ResizeRedraw |
                ControlStyles.OptimizedDoubleBuffer |
                ControlStyles.SupportsTransparentBackColor,
                    true
            );
            UpdateStyles();
            base.Font = MetroFonts.Regular(10);
            EvaluateVars();
            ApplyTheme();
            T_Defaults();
        }
 
        private void EvaluateVars()
        {
            _utl = new Utilites();
        }
 
        private void T_Defaults()
        {
            _wordWrap = true;
            _autoWordSelection = false;
            _foreColor = Color.FromArgb(20, 20, 20);
 
            _borderColor = Color.FromArgb(155, 155, 155);
            _hoverColor = Color.FromArgb(102, 102, 102);
            _backColor = Color.FromArgb(238, 238, 238);
            _richTextBox.BackColor = BackColor;
            _richTextBox.ForeColor = ForeColor;
            _readOnly = false;
            _maxLength = 32767;
            _state = MouseMode.Normal;
            _lines = null;
            _richTextBox.Cursor = Cursors.IBeam;
            _richTextBox.BorderStyle = BorderStyle.None;
            _richTextBox.Location = new(7, 8);
            _richTextBox.Font = Font;
            _richTextBox.Size = new(Width, Height);
 
            _richTextBox.MouseHover += T_MouseHover;
            _richTextBox.MouseUp += T_MouseUp;
            _richTextBox.Leave += T_Leave;
            _richTextBox.Enter += T_Enter;
            _richTextBox.KeyDown += T_KeyDown;
            _richTextBox.TextChanged += T_TextChanged;
        }
 
        #endregion Constructors
 
        #region Draw Control
 
        protected override void OnPaint(PaintEventArgs e)
        {
            Graphics g = e.Graphics;
            Rectangle rect = new(0, 0, Width - 1, Height - 1);
            g.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;
 
            if (Enabled)
            {
                using SolidBrush bg = new(BackColor);
                using Pen p = new(BorderColor);
                using Pen ph = new(HoverColor);
                g.FillRectangle(bg, rect);
                switch (_state)
                {
                    case MouseMode.Normal:
                        g.DrawRectangle(p, rect);
                        break;
                    case MouseMode.Hovered:
                        g.DrawRectangle(ph, rect);
                        break;
                }
 
                _richTextBox.BackColor = BackColor;
                _richTextBox.ForeColor = ForeColor;
            }
            else
            {
                using SolidBrush bg = new(DisabledBackColor);
                using Pen p = new(DisabledBorderColor);
                g.FillRectangle(bg, rect);
                g.DrawRectangle(p, rect);
                _richTextBox.BackColor = DisabledBackColor;
                _richTextBox.ForeColor = DisabledForeColor;
            }
 
            _richTextBox.Location = new(7, 4);
            _richTextBox.Width = Width - 10;
 
        }
 
        #endregion Draw Control
 
        #region ApplyTheme
 
        private void ApplyTheme(Style style = Style.Light)
        {
            if (!IsDerivedStyle)
            {
                return;
            }
 
            switch (style)
            {
                case Style.Light:
                    ForeColor = Color.FromArgb(20, 20, 20);
                    BackColor = Color.FromArgb(238, 238, 238);
                    HoverColor = Color.FromArgb(102, 102, 102);
                    BorderColor = Color.FromArgb(155, 155, 155);
                    DisabledBackColor = Color.FromArgb(204, 204, 204);
                    DisabledBorderColor = Color.FromArgb(155, 155, 155);
                    DisabledForeColor = Color.FromArgb(136, 136, 136);
                    ThemeAuthor = "Taiizor";
                    ThemeName = "MetroLight";
                    UpdateProperties();
                    break;
                case Style.Dark:
                    ForeColor = Color.FromArgb(204, 204, 204);
                    BackColor = Color.FromArgb(34, 34, 34);
                    HoverColor = Color.FromArgb(170, 170, 170);
                    BorderColor = Color.FromArgb(110, 110, 110);
                    DisabledBackColor = Color.FromArgb(80, 80, 80);
                    DisabledBorderColor = Color.FromArgb(109, 109, 109);
                    DisabledForeColor = Color.FromArgb(109, 109, 109);
                    ThemeAuthor = "Taiizor";
                    ThemeName = "MetroDark";
                    UpdateProperties();
                    break;
                case Style.Custom:
                    if (StyleManager != null)
                    {
                        foreach (System.Collections.Generic.KeyValuePair<string, object> varkey in StyleManager.RichTextBoxDictionary)
                        {
                            switch (varkey.Key)
                            {
                                case "ForeColor":
                                    ForeColor = _utl.HexColor((string)varkey.Value);
                                    break;
                                case "BackColor":
                                    BackColor = _utl.HexColor((string)varkey.Value);
                                    break;
                                case "HoverColor":
                                    HoverColor = _utl.HexColor((string)varkey.Value);
                                    break;
                                case "BorderColor":
                                    BorderColor = _utl.HexColor((string)varkey.Value);
                                    break;
                                case "DisabledBackColor":
                                    DisabledBackColor = _utl.HexColor((string)varkey.Value);
                                    break;
                                case "DisabledBorderColor":
                                    DisabledBorderColor = _utl.HexColor((string)varkey.Value);
                                    break;
                                case "DisabledForeColor":
                                    DisabledForeColor = _utl.HexColor((string)varkey.Value);
                                    break;
                                default:
                                    return;
                            }
                        }
                    }
 
                    UpdateProperties();
                    break;
                default:
                    throw new ArgumentOutOfRangeException(nameof(style), style, null);
            }
        }
 
        private void UpdateProperties()
        {
            Invalidate();
            _richTextBox.Invalidate();
        }
 
        #endregion ApplyTheme
 
        #region Events
 
        public new event TextChangedEventHandler TextChanged;
 
        public delegate void TextChangedEventHandler(object sender);
 
        public event SelectionChangedEventHandler SelectionChanged;
 
        public delegate void SelectionChangedEventHandler(object sender, EventArgs e);
 
        public event LinkClickedEventHandler LinkClicked;
 
        public delegate void LinkClickedEventHandler(object sender, EventArgs e);
 
        public event ProtectedEventHandler Protected;
 
        public delegate void ProtectedEventHandler(object sender, EventArgs e);
 
        private void T_SelectionChanged(object sender, EventArgs e)
        {
            SelectionChanged?.Invoke(sender, e);
        }
 
        private void T_LinkClicked(object sender, EventArgs e)
        {
            LinkClicked?.Invoke(sender, e);
        }
 
        private void T_Protected(object sender, EventArgs e)
        {
            Protected?.Invoke(sender, e);
        }
 
        public void T_Leave(object sender, EventArgs e)
        {
            base.OnMouseLeave(e);
            Invalidate();
        }
 
        protected override void OnMouseLeave(EventArgs e)
        {
            base.OnMouseLeave(e);
            _state = MouseMode.Normal;
            Invalidate();
        }
 
        protected override void OnMouseUp(MouseEventArgs e)
        {
            base.OnMouseUp(e);
            _state = MouseMode.Hovered;
            Invalidate();
        }
 
        public void T_MouseUp(object sender, MouseEventArgs e)
        {
            base.OnMouseUp(e);
            if (e.Button == MouseButtons.Right)
            {
                if (ContextMenuStrip != null)
                {
                    ContextMenuStrip.Show(_richTextBox, new Point(e.X, e.Y));
                }
            }
            Invalidate();
        }
 
        protected override void OnMouseEnter(EventArgs e)
        {
            base.OnMouseEnter(e);
            _state = MouseMode.Hovered;
            Invalidate();
        }
 
        protected override void OnMouseHover(EventArgs e)
        {
            base.OnMouseHover(e);
            _state = MouseMode.Hovered;
            Invalidate();
        }
 
        public void T_MouseHover(object sender, EventArgs e)
        {
            base.OnMouseHover(e);
            Invalidate();
        }
 
        protected override void OnResize(EventArgs e)
        {
            base.OnResize(e);
            _richTextBox.Size = new(Width - 10, Height - 10);
        }
 
        public void T_Enter(object sender, EventArgs e)
        {
            base.OnMouseEnter(e);
            Invalidate();
        }
 
        private void T_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.Control && e.KeyCode == Keys.A)
            {
                e.SuppressKeyPress = true;
            }
 
            if (e.Control && e.KeyCode == Keys.C)
            {
                _richTextBox.Copy();
                e.SuppressKeyPress = true;
            }
        }
 
        private void T_TextChanged(object sender, EventArgs e)
        {
            Text = _richTextBox.Text;
            TextChanged?.Invoke(this);
            Invalidate();
        }
 
        protected override void OnCreateControl()
        {
            base.OnCreateControl();
            if (!Controls.Contains(_richTextBox))
            {
                Controls.Add(_richTextBox);
            }
        }
 
        public void AppendText(string text)
        {
            if (_richTextBox != null)
            {
                _richTextBox.AppendText(text);
            }
        }
 
        public void Undo()
        {
            if (_richTextBox != null)
            {
                if (_richTextBox.CanUndo)
                {
                    _richTextBox.Undo();
                }
            }
        }
 
        public int GetLineFromCharIndex(int index)
        {
            if (_richTextBox != null)
            {
                return _richTextBox.GetLineFromCharIndex(index);
            }
            else
            {
                return 0;
            }
        }
 
        public Point GetPositionFromCharIndex(int index)
        {
            return _richTextBox.GetPositionFromCharIndex(index);
        }
 
        public int GetCharIndexFromPosition(Point pt)
        {
            if (_richTextBox == null)
            {
                return 0;
            }
 
            return _richTextBox.GetCharIndexFromPosition(pt);
        }
 
        public void ClearUndo()
        {
            if (_richTextBox == null)
            {
                return;
            }
 
            _richTextBox.ClearUndo();
        }
 
        public void Copy()
        {
            if (_richTextBox == null)
            {
                return;
            }
 
            _richTextBox.Copy();
        }
 
        public void Cut()
        {
            if (_richTextBox == null)
            {
                return;
            }
 
            _richTextBox.Cut();
        }
 
        public void SelectAll()
        {
            if (_richTextBox == null)
            {
                return;
            }
 
            _richTextBox.SelectAll();
        }
 
        public void DeselectAll()
        {
            if (_richTextBox == null)
            {
                return;
            }
 
            _richTextBox.DeselectAll();
        }
 
        public void Select(int start, int length)
        {
            if (_richTextBox == null)
            {
                return;
            }
 
            _richTextBox.Select(start, length);
        }
 
        public void Paste(DataFormats.Format clipFormat)
        {
            if (_richTextBox == null)
            {
                return;
            }
 
            _richTextBox.Paste(clipFormat);
        }
 
        public void LoadFile(string path)
        {
            if (_richTextBox == null)
            {
                return;
            }
 
            _richTextBox.LoadFile(path);
        }
 
        public void LoadFile(string path, RichTextBoxStreamType fileType)
        {
            if (_richTextBox == null)
            {
                return;
            }
 
            _richTextBox.LoadFile(path, fileType);
        }
 
        public void LoadFile(System.IO.Stream data, RichTextBoxStreamType fileType)
        {
            if (_richTextBox == null)
            {
                return;
            }
 
            _richTextBox.LoadFile(data, fileType);
        }
 
        public void SaveFile(string path)
        {
            if (_richTextBox == null)
            {
                return;
            }
 
            _richTextBox.SaveFile(path);
        }
 
        public void SaveFile(string path, RichTextBoxStreamType fileType)
        {
            if (_richTextBox == null)
            {
                return;
            }
 
            _richTextBox.SaveFile(path, fileType);
        }
 
        public void SaveFile(System.IO.Stream data, RichTextBoxStreamType fileType)
        {
            if (_richTextBox == null)
            {
                return;
            }
 
            _richTextBox.SaveFile(data, fileType);
        }
 
        public bool CanPaste(DataFormats.Format clipFormat)
        {
            return _richTextBox.CanPaste(clipFormat);
        }
 
        public int Find(char[] characterSet)
        {
            if (_richTextBox == null)
            {
                return 0;
            }
 
            return _richTextBox.Find(characterSet);
        }
 
        public int Find(char[] characterSet, int start)
        {
            if (_richTextBox == null)
            {
                return 0;
            }
 
            return _richTextBox.Find(characterSet, start);
        }
 
        public int Find(char[] characterSet, int start, int ends)
        {
            if (_richTextBox == null)
            {
                return 0;
            }
 
            return _richTextBox.Find(characterSet, start, ends);
        }
 
        public int Find(string str)
        {
            if (_richTextBox == null)
            {
                return 0;
            }
 
            return _richTextBox.Find(str);
        }
 
        public int Find(string str, int start, int ends, RichTextBoxFinds options)
        {
            if (_richTextBox == null)
            {
                return 0;
            }
 
            return _richTextBox.Find(str, start, ends, options);
        }
 
        public int Find(string str, RichTextBoxFinds options)
        {
            if (_richTextBox == null)
            {
                return 0;
            }
 
            return _richTextBox.Find(str, options);
        }
 
        public int Find(string str, int start, RichTextBoxFinds options)
        {
            if (_richTextBox == null)
            {
                return 0;
            }
 
            return _richTextBox.Find(str, start, options);
        }
 
        #endregion Events
 
        #region Properties
 
        [Browsable(false), EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public BorderStyle BorderStyle => BorderStyle.None;
 
        [Category("Metro"), Description("Gets or sets how text is aligned in a RichTextBox control.")]
        public int MaxLength
        {
            get => _maxLength;
            set
            {
                _maxLength = value;
                if (_richTextBox != null)
                {
                    _richTextBox.MaxLength = value;
                }
 
                Invalidate();
            }
        }
 
        [Category("Metro")]
        [Description("Gets or sets the background color of the control.")]
        public override Color BackColor
        {
            get => _backColor;
            set
            {
                _backColor = value;
                _richTextBox.BackColor = value;
                Invalidate();
            }
        }
 
        [Category("Metro")]
        [Description("Gets or sets the color of the control whenever hovered.")]
        public Color HoverColor
        {
            get => _hoverColor;
            set
            {
                _hoverColor = value;
                Invalidate();
            }
        }
 
        [Category("Metro")]
        [Description("Gets or sets the border color of the control.")]
        public Color BorderColor
        {
            get => _borderColor;
            set
            {
                _borderColor = value;
                Invalidate();
            }
        }
 
        [Category("Metro")]
        [Description("Gets or sets the foreground color of the control.")]
        [Browsable(false)]
        public override Color ForeColor
        {
            get => _foreColor;
            set
            {
                _foreColor = value;
                _richTextBox.ForeColor = value;
                Invalidate();
            }
        }
 
        [Category("Metro"), Description("Gets or sets a value indicating whether text in the RichTextBox is read-only.")]
        public bool ReadOnly
        {
            get => _readOnly;
            set
            {
                _readOnly = value;
                if (_richTextBox != null)
                {
                    _richTextBox.ReadOnly = value;
                }
            }
        }
 
        [Browsable(false), EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public override Image BackgroundImage => null;
 
        [Category("Metro"), Description("Gets or sets the current text in the RichTextBox.")]
        public override string Text
        {
            get => _richTextBox.Text;
            set
            {
                base.Text = value;
                if (_richTextBox != null)
                {
                    _richTextBox.Text = value;
                }
            }
        }
 
        [Category("Metro"), Description("Gets or sets the font of the text displayed by the control.")]
        public override Font Font
        {
            get => base.Font;
            set
            {
                base.Font = value;
                if (_richTextBox == null)
                {
                    return;
                }
 
                _richTextBox.Font = value;
                _richTextBox.Location = new(5, 5);
                _richTextBox.Width = Width - 8;
            }
        }
 
        [Category("Metro"), Description("Indicates whether a multiline text box control automatically wraps words to the beginning of the next line when necessary.")]
        public bool WordWrap
        {
            get => _wordWrap;
            set
            {
                _wordWrap = value;
                if (_richTextBox != null)
                {
                    _richTextBox.WordWrap = value;
                }
            }
        }
 
        [Category("Metro"), Description("Gets or sets a value indicating whether automatic word selection is enabled.")]
        public bool AutoWordSelection
        {
            get => _autoWordSelection;
            set
            {
                _autoWordSelection = value;
                if (_richTextBox != null)
                {
                    _richTextBox.AutoWordSelection = value;
                }
            }
        }
 
        [Category("Metro"), Description("Gets or sets the lines of text in the control.")]
        public string[] Lines
        {
            get => _lines;
            set
            {
                _lines = value;
                if (_richTextBox != null)
                {
                    _richTextBox.Lines = value;
                }
 
                Invalidate();
            }
        }
 
        [Category("Metro"), Description("Gets or sets the ContextMenuStrip associated with this control.")]
        public override ContextMenuStrip ContextMenuStrip
        {
            get => base.ContextMenuStrip;
            set
            {
                base.ContextMenuStrip = value;
                if (_richTextBox == null)
                {
                    return;
                }
 
                _richTextBox.ContextMenuStrip = value;
                Invalidate();
            }
        }
 
        [Category("Metro")]
        [Description("Gets or sets back color used by the control while disabled.")]
        public Color DisabledBackColor
        {
            get => _disabledBackColor;
            set
            {
                _disabledBackColor = value;
                Refresh();
            }
        }
 
        [Category("Metro")]
        [Description("Gets or sets the fore color of the control whenever while disabled")]
        public Color DisabledForeColor
        {
            get => _disabledForeColor;
            set
            {
                _disabledForeColor = value;
                Refresh();
            }
        }
 
        [Category("Metro")]
        [Description("Gets or sets the border color of the control while disabled.")]
        public Color DisabledBorderColor
        {
            get => _disabledBorderColor;
            set
            {
                _disabledBorderColor = value;
                Refresh();
            }
        }
 
        [Category("Metro")]
        [Description("Gets or sets the whether this control reflect to parent(s) style. \n " +
                     "Set it to false if you want the style of this control be independent. ")]
        public bool IsDerivedStyle
        {
            get => _isDerivedStyle;
            set
            {
                _isDerivedStyle = value;
                Refresh();
            }
        }
 
        #endregion Properties
    }
 
    #endregion
}