protected override void OnPaint(PaintEventArgs e) { Height = 24; Graphics g = e.Graphics; g.TextRenderingHint = TextRenderingHint.AntiAlias; g.Clear(Drawer.HtmlColor("158cba")); g.DrawString(Text, Font, Drawer.Brush("fff"), 4, 4); g.DrawString(ActiveTasks, Font, Drawer.Brush("fff"), ClientRectangle.Width - ((int)g.MeasureString(ActiveTasks, Font).Width + 4), 4); }
protected override void OnPaint(PaintEventArgs e) { Height = 40; Graphics g = e.Graphics; BackColor = Drawer.HtmlColor("f8f8f8"); g.Clear(Drawer.HtmlColor("f8f8f8")); g.TextRenderingHint = TextRenderingHint.AntiAlias; g.DrawString(Text, Font, Drawer.Brush("333333"), 12, 10); g.DrawLine(Drawer.Pen("e7e7e7", 4), new Point(0, Height - 1), new Point(Width, Height - 1)); }
protected override void OnPaint(PaintEventArgs e) { Graphics g = e.Graphics; Width = (int)g.MeasureString(Text, Font).Width + 6; Height = (int)g.MeasureString(Text, Font).Height + 6; g.TextRenderingHint = TextRenderingHint.AntiAlias; g.DrawString(Text, Font, Drawer.Brush("333333"), new Point((((ClientRectangle.Width - (int)g.MeasureString(Text, Font).Width)) / 2) + 1, ((ClientRectangle.Height - (int)g.MeasureString(Text, Font).Height)) / 2)); }
protected override void OnPaint(PaintEventArgs e) { if (Disposing || IsDisposed) { return; } Graphics g = e.Graphics; g.TextRenderingHint = TextRenderingHint.ClearTypeGridFit; var usingFont = new Font(FontFamily.GenericSansSerif, 8F, FontStyle.Regular); g.Clear(Parent.BackColor); g.DrawRectangle(Drawer.Pen("e7e7e7", 1), new Rectangle(3, 24, ClientRectangle.Width - 7, ClientRectangle.Height - 28)); if (TabCount < 0) { return; } for (int i = 0; i <= TabCount - 1; i++) { try { TabPages[i].BackColor = Drawer.HtmlColor("FFF"); } catch (Exception) { } var baserec = new Rectangle(GetTabRect(i).X + 1, 1, GetTabRect(i).Width - 2, GetTabRect(i).Height + 2); if (i == SelectedIndex) { g.DrawRectangle(Drawer.Pen("e7e7e7", 1), baserec); g.FillRectangle(Drawer.Brush("fff"), new Rectangle(baserec.X + 1, baserec.Y + 1, baserec.Width - 1, baserec.Height + 10)); int center = Convert.ToInt32((baserec.Width - (int)g.MeasureString(TabPages[i].Text, usingFont).Width) / 2); g.DrawString(TabPages[i].Text, usingFont, Drawer.Brush("303030"), new Point(baserec.X + center, baserec.Y + 1 + (baserec.Height - (int)g.MeasureString(TabPages[i].Text, usingFont).Height) / 2)); } else { g.DrawRectangle(Drawer.Pen("e7e7e7", 1), new Rectangle(baserec.X, baserec.Y + 2, baserec.Width, baserec.Height - 2)); g.DrawString(TabPages[i].Text, usingFont, new SolidBrush(ColorTranslator.FromHtml("#A3A3A3")), new Point(baserec.X + (baserec.Width - (int)g.MeasureString(TabPages[i].Text, usingFont).Width) / 2, baserec.Y + 1 + (baserec.Height - (int)g.MeasureString(TabPages[i].Text, usingFont).Height) / 2)); } } }
protected override void OnPaint(PaintEventArgs e) { Font usingFont = new Font(Drawer.FontLoader.FontCollection.Families[0], 10, FontStyle.Regular); Graphics g = e.Graphics; g.TextRenderingHint = TextRenderingHint.AntiAliasGridFit; g.Clear(Drawer.HtmlColor("158cba")); g.DrawLine(Drawer.Pen("127BA3", 3), 0, Height - 2, Width, Height - 2); if (!Enabled) { g.FillRectangle(Drawer.Brush("525252"), ClientRectangle); } else if (Clicked) { g.FillRectangle(new SolidBrush(Color.FromArgb(80, 0, 0, 0)), ClientRectangle); Clicked = false; } else if (Hover) { g.FillRectangle(new SolidBrush(Color.FromArgb(30, 0, 0, 0)), ClientRectangle); } g.DrawString(Text, usingFont, Drawer.Brush("fff"), new Point((((ClientRectangle.Width - (int)g.MeasureString(Text, usingFont).Width)) / 2) + 1, ((ClientRectangle.Height - (int)g.MeasureString(Text, usingFont).Height)) / 2)); }