protected override void OnCreateControl() { base.OnCreateControl(); if (Primary) { ForeColor = MaterialSkinManager.GetPrimaryTextColor(); } else { ForeColor = MaterialSkinManager.GetSecondaryTextColor(); } Font = new Font(MaterialSkinManager.ROBOTO_REGULAR_11.FontFamily, FontSize); BackColorChanged += (sender, args) => { if (Primary) { ForeColor = MaterialSkinManager.GetPrimaryTextColor(); } else { ForeColor = MaterialSkinManager.GetSecondaryTextColor(); } }; }
protected override void OnCreateControl() { base.OnCreateControl(); if (Primary) { ForeColor = MaterialSkinManager.GetPrimaryTextColor(); } else { ForeColor = MaterialSkinManager.GetSecondaryTextColor(); } Font = new Font(MaterialSkinManager.ROBOTO_REGULAR_11.FontFamily, FontSize); BackColorChanged += (sender, args) => { if (Primary) { ForeColor = MaterialSkinManager.GetPrimaryTextColor(); } else { ForeColor = MaterialSkinManager.GetSecondaryTextColor(); } }; Shadow = null; GraphicsPath gp = new GraphicsPath(); gp.AddRectangle(ClientRectangle); ShadowShape = gp; }
protected override void OnCreateControl() { base.OnCreateControl(); baseTextBox.BackColor = BackColor; baseTextBox.ForeColor = MaterialSkinManager.GetPrimaryTextColor(); baseTextBox.Location = new Point(0, 0); baseTextBox.Width = Width; Height = baseTextBox.Height + 5; }
public MaterialSingleLineTextField() { SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.DoubleBuffer, true); SetStyle(ControlStyles.SupportsTransparentBackColor, false); animationManager = new AnimationManager { Increment = 0.06, AnimationType = AnimationType.EaseInOut, InterruptAnimation = false }; animationManager.OnAnimationProgress += sender => Invalidate(); baseTextBox = new BaseTextBox { BorderStyle = BorderStyle.None, Font = MaterialSkinManager.ROBOTO_REGULAR_11, ForeColor = MaterialSkinManager.GetPrimaryTextColor(), Location = new Point(0, 0), Width = Width, Height = Height - 5 }; if (!Controls.Contains(baseTextBox) && !DesignMode) { Controls.Add(baseTextBox); } baseTextBox.GotFocus += (sender, args) => animationManager.StartNewAnimation(AnimationDirection.In); baseTextBox.LostFocus += (sender, args) => animationManager.StartNewAnimation(AnimationDirection.Out); baseTextBox.KeyDown += (sender, args) => _baseKeyDown(args); baseTextBox.KeyUp += (sender, args) => _baseKeyUp(args); baseTextBox.KeyPress += (sender, args) => _baseKeyPress(args); BackColorChanged += (sender, args) => { baseTextBox.BackColor = BackColor; baseTextBox.ForeColor = MaterialSkinManager.GetPrimaryTextColor(); }; //Fix for tabstop baseTextBox.TabStop = true; this.TabStop = false; }