private void taskbar_Paint(object sender, PaintEventArgs e) { var gfx = e.Graphics; gfx.Clear(currentTheme.threeDObjectsColor); var _lightBack = Paintbrush.GetLightFromColor(currentTheme.threeDObjectsColor); gfx.DrawLine(new Pen(_lightBack), 0, 1, taskbar.Width, 1); }
private void left_Paint(object sender, PaintEventArgs e) { var gfx = e.Graphics; gfx.Clear(SaveSystem.currentTheme.threeDObjectsColor); var _lightBack = Paintbrush.GetLightFromColor(SaveSystem.currentTheme.threeDObjectsColor); gfx.DrawLine(new Pen(_lightBack), 1, 0, 1, left.Height); }
protected override void OnPaint(PaintEventArgs e) { base.OnPaint(e); var textboxcolor = Color.Silver; if (SaveSystem.currentTheme != null) { textboxcolor = SaveSystem.currentTheme.windowColor; } if (SaveSystem.currentTheme != null) { BackColor = SaveSystem.currentTheme.threeDObjectsColor; } else { BackColor = Color.White; } var _lightBack = Paintbrush.GetLightFromColor(textboxcolor); var _darkBack = Paintbrush.GetDarkFromColor(textboxcolor); if (SaveSystem.currentTheme != null) { Font = SaveSystem.currentTheme.buttonFont; } else { Font = new Font("Microsoft Sans Serif", 8.25F, FontStyle.Regular); } var g = e.Graphics; g.Clear(BackColor); g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.SingleBitPerPixelGridFit; if (UseSystemPasswordChar) { g.DrawString(new string('●', Text.Length), Font, Brushes.Black, 3, 3); } else { g.DrawString(Text, Font, Brushes.Black, 3, 3); } g.DrawLine(new Pen(_darkBack), 0, 0, Width - 2, 0); g.DrawLine(new Pen(_lightBack), Width - 1, 0, Width - 1, Height - 1); g.DrawLine(new Pen(_lightBack), 0, Height - 1, Width - 1, Height - 1); g.DrawLine(new Pen(_darkBack), 0, 0, 0, Height - 2); g.DrawLine(Pens.Black, 1, 1, Width - 3, 1); g.DrawLine(Pens.Black, 1, 1, 1, Height - 3); g.DrawLine(new Pen(textboxcolor), 1, Height - 2, Width - 2, Height - 2); g.DrawLine(new Pen(textboxcolor), Width - 2, Height - 2, Width - 2, 1); }
private void toprightcorner_Paint(object sender, PaintEventArgs e) { var gfx = e.Graphics; gfx.Clear(SaveSystem.currentTheme.threeDObjectsColor); var _lightBack = Paintbrush.GetLightFromColor(SaveSystem.currentTheme.threeDObjectsColor); var _darkBack = Paintbrush.GetDarkFromColor(SaveSystem.currentTheme.threeDObjectsColor); gfx.DrawLine(new Pen(_lightBack), 0, 1, 1, 1); gfx.DrawLine(new Pen(_darkBack), 2, 1, 2, 3); gfx.DrawLine(Pens.Black, 3, 0, 3, 3); }
private void clockPanel_Paint(object sender, PaintEventArgs e) { var gfx = e.Graphics; gfx.Clear(currentTheme.threeDObjectsColor); var _lightBack = Paintbrush.GetLightFromColor(currentTheme.threeDObjectsColor); var _darkBack = Paintbrush.GetDarkFromColor(currentTheme.threeDObjectsColor); gfx.DrawLine(new Pen(_lightBack), 0, 1, clockPanel.Width, 1); gfx.DrawLine(new Pen(_darkBack), 0, 24, 0, 4); gfx.DrawLine(new Pen(_darkBack), 61, 4, 0, 4); gfx.DrawLine(new Pen(_lightBack), 62, 4, 62, 25); gfx.DrawLine(new Pen(_lightBack), 0, 25, 62, 25); }
private void startmenu_Paint(object sender, PaintEventArgs e) { var gfx = e.Graphics; gfx.Clear(currentTheme.threeDObjectsColor); var _lightBack = Paintbrush.GetLightFromColor(currentTheme.threeDObjectsColor); var _darkBack = Paintbrush.GetDarkFromColor(currentTheme.threeDObjectsColor); gfx.DrawLine(Pens.Black, 0, startmenu.Height - 1, startmenu.Width - 1, startmenu.Height - 1); gfx.DrawLine(Pens.Black, startmenu.Width - 1, startmenu.Height - 1, startmenu.Width - 1, 0); gfx.DrawLine(new Pen(_darkBack), 1, startmenu.Height - 2, startmenu.Width - 2, startmenu.Height - 2); gfx.DrawLine(new Pen(_darkBack), startmenu.Width - 2, 1, startmenu.Width - 2, startmenu.Height - 2); gfx.DrawLine(new Pen(_lightBack), 1, startmenu.Height - 3, 1, 1); gfx.DrawLine(new Pen(_lightBack), startmenu.Width - 3, 1, 1, 1); }
private void panel1_Paint(object sender, PaintEventArgs e) { if (SaveSystem.currentTheme != null) { BackColor = SaveSystem.currentTheme.threeDObjectsColor; } else { BackColor = Color.Silver; } var _lightBack = Paintbrush.GetLightFromColor(BackColor); var _darkBack = Paintbrush.GetDarkFromColor(BackColor); var g = e.Graphics; g.Clear(BackColor); g.FillRectangle(Brushes.Black, new Rectangle(0, 0, Width, Height)); g.FillRectangle(new SolidBrush(_lightBack), new Rectangle(0, 0, Width - 1, Height - 1)); g.FillRectangle(new SolidBrush(_darkBack), new Rectangle(1, 1, Width - 2, Height - 2)); g.FillRectangle(new SolidBrush(BackColor), new Rectangle(1, 1, Width - 3, Height - 3)); }
protected override void OnPaint(PaintEventArgs e) { base.OnPaint(e); if (SaveSystem.currentTheme != null && AdaptBackColorWithTheme) { BackColor = SaveSystem.currentTheme.threeDObjectsColor; } if (AdaptForeColorWithTheme) { if (SaveSystem.currentTheme != null) { ForeColor = SaveSystem.currentTheme.threeDObjectsTextColor; } else { ForeColor = Color.Black; } } if (AdaptFontWithTheme) { if (SaveSystem.currentTheme != null) { Font = SaveSystem.currentTheme.buttonFont; } else { Font = new Font("Microsoft Sans Serif", 8.25F, FontStyle.Regular); } } _lightBack = Paintbrush.GetLightFromColor(BackColor); _darkBack = Paintbrush.GetDarkFromColor(BackColor); var g = e.Graphics; g.Clear(BackColor); g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.SingleBitPerPixelGridFit; StringFormat sf = new StringFormat(); sf.Alignment = StringAlignment.Center; sf.LineAlignment = StringAlignment.Center; sf.HotkeyPrefix = System.Drawing.Text.HotkeyPrefix.Show; if (_pressing && Enabled) { g.FillRectangle(new SolidBrush(_lightBack), new Rectangle(0, 0, Width, Height)); g.FillRectangle(Brushes.Black, new Rectangle(0, 0, Width - 1, Height - 1)); g.FillRectangle(new SolidBrush(_darkBack), new Rectangle(1, 1, Width - 2, Height - 2)); g.FillRectangle(new SolidBrush(BackColor), new Rectangle(2, 2, Width - 3, Height - 3)); g.DrawString(Text, Font, new SolidBrush(ForeColor), new Rectangle(2, 2, Width - 3, Height - 3), sf); } else { g.FillRectangle(Brushes.Black, new Rectangle(0, 0, Width, Height)); g.FillRectangle(new SolidBrush(_lightBack), new Rectangle(0, 0, Width - 1, Height - 1)); g.FillRectangle(new SolidBrush(_darkBack), new Rectangle(1, 1, Width - 2, Height - 2)); g.FillRectangle(new SolidBrush(BackColor), new Rectangle(1, 1, Width - 3, Height - 3)); if (Enabled) { g.DrawString(Text, Font, new SolidBrush(ForeColor), new Rectangle(1, 1, Width - 3, Height - 3), sf); } else { g.DrawString(Text, Font, new SolidBrush(_darkBack), new Rectangle(1, 1, Width - 3, Height - 3), sf); } } }
public ClassicDropDown() { InitializeComponent(); try { // Draw the border this.Paint += new PaintEventHandler((object sender, PaintEventArgs e) => { // Update a bunch of variables! textBox1.Font = Font; if (SaveSystem.currentTheme != null) { textBox1.BackColor = SaveSystem.currentTheme.threeDObjectsColor; BackColor = SaveSystem.currentTheme.threeDObjectsColor; textboxcolor = SaveSystem.currentTheme.windowColor; _lightBack = Paintbrush.GetLightFromColor(textboxcolor); _darkBack = Paintbrush.GetDarkFromColor(textboxcolor); } else { textBox1.BackColor = Color.White; BackColor = Color.White; } }); tborder.Paint += new PaintEventHandler((object sender, PaintEventArgs e) => { e.Graphics.DrawLine(new Pen(_darkBack), 0, 0, tborder.Width, 0); e.Graphics.DrawLine(Pens.Black, 0, 1, tborder.Width, 1); }); lborder.Paint += new PaintEventHandler((object sender, PaintEventArgs e) => { e.Graphics.DrawLine(new Pen(_darkBack), 0, 0, 0, Height); e.Graphics.DrawLine(Pens.Black, 1, 0, 1, Height); }); rborder.Paint += new PaintEventHandler((object sender, PaintEventArgs e) => { e.Graphics.DrawLine(new Pen(_lightBack), 0, 0, 0, Height - 1); e.Graphics.DrawLine(new Pen(textboxcolor), 1, 0, 1, Height - 1); }); bborder.Paint += new PaintEventHandler((object sender, PaintEventArgs e) => { e.Graphics.DrawLine(new Pen(_lightBack), 0, 0, Width - 1, 0); e.Graphics.DrawLine(new Pen(textboxcolor), 0, 1, Width - 2, 1); }); tborder.Invalidate(); lborder.Invalidate(); rborder.Invalidate(); bborder.Invalidate(); } catch { } }