[C#] YouTubeTabControl
using Microsoft.VisualBasic;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Diagnostics;
class YouTubeTabControl : TabControlDesigner
{
private SolidBrush B1;
private SolidBrush B2;
private SolidBrush B3;
private SolidBrush B4;
private SolidBrush B5;
private SolidBrush B6;
private SolidBrush B7;
private Pen P1;
private Pen P2;
private Rectangle R1;
private Rectangle R2;
private Rectangle R3;
public YouTubeTabControl()
{
SetColor("Selected Tab #1", 28, 28, 28);
SetColor("Selected Tab #2", 196, 48, 43);
SetColor("Unselected Tab", 39, 39, 39);
SetColor("Hover Tab #1", 28, 28, 28);
SetColor("Hover Tab #2", 102, 102, 102);
SetColor("Panel Color", 39, 39, 39);
SetColor("Back Color", 236, 236, 236);
SetColor("Highlight #1", 50, 50, 50);
SetColor("Highlight #2", 27, 27, 27);
Alignment = TabAlignment.Left;
SizeMode = TabSizeMode.Fixed;
Font = new Font("Verdana", 8);
ItemSize = new Size(37, 200);
Dock = DockStyle.Fill;
}
protected override void ColorHook()
{
B1 = GetBrush("Selected Tab #1");
B2 = GetBrush("Selected Tab #2");
B3 = GetBrush("Unselected Tab");
B4 = GetBrush("Hover Tab #1");
B5 = GetBrush("Hover Tab #2");
B6 = GetBrush("Panel Color");
B7 = GetBrush("Back Color");
P1 = GetPen("Highlight #1");
P2 = GetPen("Highlight #2");
}
protected override void PaintHook()
{
R1 = new Rectangle(0, 0, ItemSize.Height + 1, Height);
R2 = new Rectangle(ItemSize.Height - 1, 0, Width - ItemSize.Height, Height);
G.FillRectangle(B6, R1);
G.FillRectangle(B7, R2);
}
protected override void TabPaint(int Index)
{
try {
TabPages(Index).BackColor = B7.Color;
} catch {
}
string T = TabPages(Index).Text;
R1 = GetTabRect(Index);
R2 = new Rectangle(R1.X - 1, R1.Y - 1, R1.Width - 4, R1.Height);
R3 = new Rectangle(R2.Right - 2, R2.Top, 4, R2.Height);
if (SelectedIndex == Index) {
G.FillRectangle(B1, R2);
G.FillRectangle(B2, R3);
G.DrawString(T, Font, Brushes.White, Center(T, R2));
} else if (State == MouseState.Over && R2.Contains(Coordinates)) {
G.FillRectangle(B4, R2);
G.FillRectangle(B5, R3);
G.DrawString(T, Font, Brushes.DimGray, Center(T, R2));
} else {
G.FillRectangle(B3, R2);
G.DrawString(T, Font, Brushes.DimGray, Center(T, R2));
}
G.DrawLine(P1, R2.X, R2.Y, R2.Right + 1, R2.Y);
G.DrawLine(P2, R2.X, R2.Bottom, R2.Right, R2.Bottom);
}
}
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Diagnostics;
class YouTubeTabControl : TabControlDesigner
{
private SolidBrush B1;
private SolidBrush B2;
private SolidBrush B3;
private SolidBrush B4;
private SolidBrush B5;
private SolidBrush B6;
private SolidBrush B7;
private Pen P1;
private Pen P2;
private Rectangle R1;
private Rectangle R2;
private Rectangle R3;
public YouTubeTabControl()
{
SetColor("Selected Tab #1", 28, 28, 28);
SetColor("Selected Tab #2", 196, 48, 43);
SetColor("Unselected Tab", 39, 39, 39);
SetColor("Hover Tab #1", 28, 28, 28);
SetColor("Hover Tab #2", 102, 102, 102);
SetColor("Panel Color", 39, 39, 39);
SetColor("Back Color", 236, 236, 236);
SetColor("Highlight #1", 50, 50, 50);
SetColor("Highlight #2", 27, 27, 27);
Alignment = TabAlignment.Left;
SizeMode = TabSizeMode.Fixed;
Font = new Font("Verdana", 8);
ItemSize = new Size(37, 200);
Dock = DockStyle.Fill;
}
protected override void ColorHook()
{
B1 = GetBrush("Selected Tab #1");
B2 = GetBrush("Selected Tab #2");
B3 = GetBrush("Unselected Tab");
B4 = GetBrush("Hover Tab #1");
B5 = GetBrush("Hover Tab #2");
B6 = GetBrush("Panel Color");
B7 = GetBrush("Back Color");
P1 = GetPen("Highlight #1");
P2 = GetPen("Highlight #2");
}
protected override void PaintHook()
{
R1 = new Rectangle(0, 0, ItemSize.Height + 1, Height);
R2 = new Rectangle(ItemSize.Height - 1, 0, Width - ItemSize.Height, Height);
G.FillRectangle(B6, R1);
G.FillRectangle(B7, R2);
}
protected override void TabPaint(int Index)
{
try {
TabPages(Index).BackColor = B7.Color;
} catch {
}
string T = TabPages(Index).Text;
R1 = GetTabRect(Index);
R2 = new Rectangle(R1.X - 1, R1.Y - 1, R1.Width - 4, R1.Height);
R3 = new Rectangle(R2.Right - 2, R2.Top, 4, R2.Height);
if (SelectedIndex == Index) {
G.FillRectangle(B1, R2);
G.FillRectangle(B2, R3);
G.DrawString(T, Font, Brushes.White, Center(T, R2));
} else if (State == MouseState.Over && R2.Contains(Coordinates)) {
G.FillRectangle(B4, R2);
G.FillRectangle(B5, R3);
G.DrawString(T, Font, Brushes.DimGray, Center(T, R2));
} else {
G.FillRectangle(B3, R2);
G.DrawString(T, Font, Brushes.DimGray, Center(T, R2));
}
G.DrawLine(P1, R2.X, R2.Y, R2.Right + 1, R2.Y);
G.DrawLine(P2, R2.X, R2.Bottom, R2.Right, R2.Bottom);
}
}