├── JSkinExample.png ├── NetSealExAmethyst.png ├── NetSealExClouds.png ├── NetSealExEmerald.png ├── NetSealExOriginal.png ├── NetSealExPrBlue.png ├── AevionThemeExample.png ├── NetSealExBrightGreen.png ├── PositronThemeExample.png ├── Windows Forms Themes ├── JSkin │ └── jSkin.dll ├── prime_theme_c#.cs ├── future_theme_c#.cs ├── flow_theme_c#.cs ├── drone_theme_c#.cs ├── modern_theme_c#.cs ├── EasyColour.cs ├── c#_purityx_theme.cs ├── aevion_theme_c#.cs ├── mephobia.cs ├── Tweety.cs └── darksky_c#_theme.cs └── Readme.md /JSkinExample.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Runnin-N-Gunnin/WinForms-Theme-Pack/HEAD/JSkinExample.png -------------------------------------------------------------------------------- /NetSealExAmethyst.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Runnin-N-Gunnin/WinForms-Theme-Pack/HEAD/NetSealExAmethyst.png -------------------------------------------------------------------------------- /NetSealExClouds.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Runnin-N-Gunnin/WinForms-Theme-Pack/HEAD/NetSealExClouds.png -------------------------------------------------------------------------------- /NetSealExEmerald.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Runnin-N-Gunnin/WinForms-Theme-Pack/HEAD/NetSealExEmerald.png -------------------------------------------------------------------------------- /NetSealExOriginal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Runnin-N-Gunnin/WinForms-Theme-Pack/HEAD/NetSealExOriginal.png -------------------------------------------------------------------------------- /NetSealExPrBlue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Runnin-N-Gunnin/WinForms-Theme-Pack/HEAD/NetSealExPrBlue.png -------------------------------------------------------------------------------- /AevionThemeExample.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Runnin-N-Gunnin/WinForms-Theme-Pack/HEAD/AevionThemeExample.png -------------------------------------------------------------------------------- /NetSealExBrightGreen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Runnin-N-Gunnin/WinForms-Theme-Pack/HEAD/NetSealExBrightGreen.png -------------------------------------------------------------------------------- /PositronThemeExample.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Runnin-N-Gunnin/WinForms-Theme-Pack/HEAD/PositronThemeExample.png -------------------------------------------------------------------------------- /Windows Forms Themes/JSkin/jSkin.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Runnin-N-Gunnin/WinForms-Theme-Pack/HEAD/Windows Forms Themes/JSkin/jSkin.dll -------------------------------------------------------------------------------- /Readme.md: -------------------------------------------------------------------------------- 1 | # [WinForms] Theme Pack (26 themes + base) 2 | 3 | ~26 custom Windows Forms themes and controls in 1 folder. 4 | 5 | ## Changelog 6 | 7 | *+Dec 2020: Added jSkin 8 | 9 | *+May 2020: Added NetSeal Themes* 10 | 11 | # Examples: 12 | 13 | ## jSkin 14 | ![Alt text](/JSkinExample.png?raw=true "jSkin Example") 15 | 16 | ## NetSeal Original 17 | ![Alt text](/NetSealExOriginal.png?raw=true "NetSeal Original Theme") 18 | 19 | ---------------------------------------------------------------- 20 | 21 | ## NetSeal Amethyst 22 | ![Alt text](/NetSealExAmethyst.png?raw=true "NetSeal Amethyst Theme") 23 | 24 | ---------------------------------------------------------------- 25 | 26 | ## NetSeal BrightGreen 27 | ![Alt text](/NetSealExBrightGreen.png?raw=true "NetSeal BrightGreen Theme") 28 | 29 | ---------------------------------------------------------------- 30 | 31 | ## NetSeal Clouds 32 | ![Alt text](/NetSealExClouds.png?raw=true "NetSeal Clouds Theme") 33 | 34 | ---------------------------------------------------------------- 35 | 36 | ## NetSeal Emerald 37 | ![Alt text](/NetSealExEmerald.png?raw=true "NetSeal Emerald Theme") 38 | 39 | ---------------------------------------------------------------- 40 | 41 | ## NetSeal Pr Blue 42 | ![Alt text](/NetSealExPrBlue.png?raw=true "NetSeal Pr Blue Theme") 43 | 44 | ---------------------------------------------------------------- 45 | 46 | ## Aevion Theme 47 | ![Alt text](/AevionThemeExample.png?raw=true "Aevion Theme") 48 | 49 | 50 | ---------------------------------------------------------------- 51 | ## Positron Theme 52 | 53 | ![Alt text](/PositronThemeExample.png?raw=true "Positron Theme") 54 | 55 | 56 | ---------------------------------------------------------------- 57 | 58 | # Base files: 59 | ```csharp 60 | + Theme Base 1.5.2 61 | + Theme Base 1.5.3 62 | + Theme Base 1.5.4 63 | ``` 64 | 65 | # Theme files: 66 | ```csharp 67 | + Aeonhack1-Positron [x] 68 | + Aeonhack2-Ghost [x] 69 | + Aevion [x] 70 | + Purityx 71 | + CC Theme 72 | + Darksky [x] 73 | + Drone 74 | + EasyColour 75 | + Flow 76 | + Fox/Firefox [x] 77 | + Future 78 | + Ghosts 79 | + Google Chrome [x] 80 | + iTalk [x] 81 | + Mephobia-Perplex [x] 82 | + Modern 83 | + Prime 84 | + Tweety [x] 85 | + VTheme [x] 86 | ``` 87 | 88 | ## NetSEAL Themes 89 | ```csharp 90 | + NetSeal Original [x] 91 | + NetSeal Amethyst [x] 92 | + NetSeal Bright Green [x] 93 | + NetSeal Clouds [x] 94 | + NetSeal Emerald [x] 95 | + NetSeal Pr Blue [x] 96 | ``` 97 | 98 | *x = tested and working* 99 | 100 | # Usage: 101 | Varies. Select your theme, import the .cs file to your project, build and check if there are any missing references or errors. You may need to include Theme Base 1.5.2, 1.5.3 or 1.5.4 (included) in your project as well. 102 | 103 | Selected Theme/controls should appear in the toolbox after building or doing a rebuild. If not, remember to reference the theme file in your main form (ex:Form1) and restart Visual Studio. 104 | 105 | **NetSeal requires Theme Base 1.5.4.** 106 | 107 | No guarantees; themes are collected from multiple sources and some may not work correctly. Original file names kept unchanged 108 | 109 | ## Credits: 110 | 111 | **aeonhack/aeon** 112 | 113 | **Mavamaarten** 114 | 115 | **PatPositron** 116 | 117 | Slurms Makenzi 118 | 119 | Ethernal Five 120 | 121 | Euras 122 | 123 | DoggyCollin 124 | 125 | Ecco 126 | 127 | HazelDev 128 | 129 | Mephobia 130 | 131 | UnReLaTeDScript 132 | -------------------------------------------------------------------------------- /Windows Forms Themes/prime_theme_c#.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Drawing; 4 | using System.Drawing.Drawing2D; 5 | using System.ComponentModel; 6 | using System.Windows.Forms; 7 | 8 | 9 | //------------------ 10 | //Creator: aeonhack 11 | //Site: elitevs.net 12 | //Created: 9/23/2011 13 | //Changed: 9/23/2011 14 | //Version: 1.0.0 15 | //Theme Base: 1.5.2 16 | //------------------ 17 | class PrimeTheme : ThemeContainer152 18 | { 19 | 20 | public PrimeTheme() 21 | { 22 | MoveHeight = 32; 23 | BackColor = Color.White; 24 | TransparencyKey = Color.Fuchsia; 25 | 26 | SetColor("Sides", 232, 232, 232); 27 | SetColor("Gradient1", 252, 252, 252); 28 | SetColor("Gradient2", 242, 242, 242); 29 | SetColor("TextShade", Color.White); 30 | SetColor("Text", 80, 80, 80); 31 | SetColor("Back", Color.White); 32 | SetColor("Border1", 180, 180, 180); 33 | SetColor("Border2", Color.White); 34 | SetColor("Border3", Color.White); 35 | SetColor("Border4", 150, 150, 150); 36 | } 37 | 38 | private Color C1; 39 | private Color C2; 40 | private Color C3; 41 | private SolidBrush B1; 42 | private SolidBrush B2; 43 | private SolidBrush B3; 44 | private Pen P1; 45 | private Pen P2; 46 | private Pen P3; 47 | 48 | private Pen P4; 49 | protected override void ColorHook() 50 | { 51 | C1 = GetColor("Sides"); 52 | C2 = GetColor("Gradient1"); 53 | C3 = GetColor("Gradient2"); 54 | 55 | B1 = new SolidBrush(GetColor("TextShade")); 56 | B2 = new SolidBrush(GetColor("Text")); 57 | B3 = new SolidBrush(GetColor("Back")); 58 | 59 | P1 = new Pen(GetColor("Border1")); 60 | P2 = new Pen(GetColor("Border2")); 61 | P3 = new Pen(GetColor("Border3")); 62 | P4 = new Pen(GetColor("Border4")); 63 | 64 | BackColor = B3.Color; 65 | } 66 | 67 | 68 | private Rectangle RT1; 69 | protected override void PaintHook() 70 | { 71 | G.Clear(C1); 72 | 73 | DrawGradient(C2, C3, 0, 0, Width, 15); 74 | 75 | DrawText(B1, HorizontalAlignment.Left, 13, 1); 76 | DrawText(B2, HorizontalAlignment.Left, 12, 0); 77 | 78 | RT1 = new Rectangle(12, 30, Width - 24, Height - 42); 79 | 80 | G.FillRectangle(B3, RT1); 81 | DrawBorders(P1, RT1, 1); 82 | DrawBorders(P2, RT1); 83 | 84 | DrawBorders(P3, 1); 85 | DrawBorders(P4); 86 | 87 | DrawCorners(TransparencyKey); 88 | } 89 | } 90 | 91 | //------------------ 92 | //Creator: aeonhack 93 | //Site: elitevs.net 94 | //Created: 9/23/2011 95 | //Changed: 9/23/2011 96 | //Version: 1.0.0 97 | //Theme Base: 1.5.2 98 | //------------------ 99 | class PrimeButton : ThemeControl152 100 | { 101 | 102 | public PrimeButton() 103 | { 104 | SetColor("DownGradient1", 215, 215, 215); 105 | SetColor("DownGradient2", 235, 235, 235); 106 | SetColor("NoneGradient1", 235, 235, 235); 107 | SetColor("NoneGradient2", 215, 215, 215); 108 | SetColor("NoneGradient3", 252, 252, 252); 109 | SetColor("NoneGradient4", 242, 242, 242); 110 | SetColor("Glow", 50, Color.White); 111 | SetColor("TextShade", Color.White); 112 | SetColor("Text", 80, 80, 80); 113 | SetColor("Border1", Color.White); 114 | SetColor("Border2", 180, 180, 180); 115 | } 116 | 117 | private Color C1; 118 | private Color C2; 119 | private Color C3; 120 | private Color C4; 121 | private Color C5; 122 | private Color C6; 123 | private SolidBrush B1; 124 | private SolidBrush B2; 125 | private SolidBrush B3; 126 | private Pen P1; 127 | 128 | private Pen P2; 129 | protected override void ColorHook() 130 | { 131 | C1 = GetColor("DownGradient1"); 132 | C2 = GetColor("DownGradient2"); 133 | C3 = GetColor("NoneGradient1"); 134 | C4 = GetColor("NoneGradient2"); 135 | C5 = GetColor("NoneGradient3"); 136 | C6 = GetColor("NoneGradient4"); 137 | 138 | B1 = new SolidBrush(GetColor("Glow")); 139 | B2 = new SolidBrush(GetColor("TextShade")); 140 | B3 = new SolidBrush(GetColor("Text")); 141 | 142 | P1 = new Pen(GetColor("Border1")); 143 | P2 = new Pen(GetColor("Border2")); 144 | } 145 | 146 | 147 | protected override void PaintHook() 148 | { 149 | if (State == MouseState.Down) 150 | { 151 | DrawGradient(C1, C2, ClientRectangle, 90); 152 | } 153 | else 154 | { 155 | DrawGradient(C3, C4, ClientRectangle, 90); 156 | DrawGradient(C5, C6, 0, 0, Width, Height / 2, 90f); 157 | } 158 | 159 | if (State == MouseState.Over) 160 | { 161 | G.FillRectangle(B1, ClientRectangle); 162 | } 163 | 164 | if (State == MouseState.Down) 165 | { 166 | DrawText(B2, HorizontalAlignment.Center, 2, 2); 167 | DrawText(B3, HorizontalAlignment.Center, 1, 1); 168 | } 169 | else 170 | { 171 | DrawText(B2, HorizontalAlignment.Center, 1, 1); 172 | DrawText(B3, HorizontalAlignment.Center, 0, 0); 173 | } 174 | 175 | DrawBorders(P1, 1); 176 | DrawBorders(P2); 177 | 178 | DrawCorners(BackColor); 179 | } 180 | } -------------------------------------------------------------------------------- /Windows Forms Themes/future_theme_c#.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Drawing; 4 | using System.Drawing.Drawing2D; 5 | using System.ComponentModel; 6 | using System.Windows.Forms; 7 | 8 | 9 | //------------------ 10 | //Creator: aeonhack 11 | //Site: elitevs.net 12 | //Created: 9/23/2011 13 | //Changed: 9/23/2011 14 | //Version: 1.0.0 15 | //Theme Base: 1.5.2 16 | //------------------ 17 | class FutureTheme : ThemeContainer152 18 | { 19 | 20 | public FutureTheme() 21 | { 22 | MoveHeight = 24; 23 | BackColor = Color.FromArgb(34, 34, 34); 24 | 25 | SetColor("Back", 34, 34, 34); 26 | SetColor("Gradient1", 34, 34, 34); 27 | SetColor("Gradient2", 23, 23, 23); 28 | SetColor("Border1", 34, 34, 34); 29 | SetColor("Border2", 49, 49, 49); 30 | SetColor("Border3", Color.Black); 31 | SetColor("Line1", Color.Black); 32 | SetColor("Line2", Color.Black); 33 | SetColor("Hatch1", Color.Black); 34 | SetColor("Hatch2", 34, 34, 34); 35 | SetColor("Shade1", 70, Color.Black); 36 | SetColor("Shade2", Color.Transparent); 37 | SetColor("Text", Color.White); 38 | } 39 | 40 | private Color C1; 41 | private Color C2; 42 | private Color C3; 43 | private Color C4; 44 | private Color C5; 45 | private Pen P1; 46 | private Pen P2; 47 | private Pen P3; 48 | private Pen P4; 49 | private Pen P5; 50 | private HatchBrush B1; 51 | 52 | private SolidBrush B2; 53 | protected override void ColorHook() 54 | { 55 | C1 = GetColor("Back"); 56 | C2 = GetColor("Gradient1"); 57 | C3 = GetColor("Gradient2"); 58 | C4 = GetColor("Shade1"); 59 | C5 = GetColor("Shade2"); 60 | 61 | P1 = new Pen(GetColor("Border1")); 62 | P2 = new Pen(GetColor("Line1")); 63 | P3 = new Pen(GetColor("Line2")); 64 | P4 = new Pen(GetColor("Border2")); 65 | P5 = new Pen(GetColor("Border3")); 66 | 67 | B1 = new HatchBrush(HatchStyle.DarkUpwardDiagonal, GetColor("Hatch1"), GetColor("Hatch2")); 68 | B2 = new SolidBrush(GetColor("Text")); 69 | 70 | BackColor = C1; 71 | } 72 | 73 | 74 | private Rectangle RT1; 75 | protected override void PaintHook() 76 | { 77 | G.Clear(C1); 78 | 79 | RT1 = new Rectangle(1, 1, Width - 2, 22); 80 | DrawGradient(C2, C3, RT1, 90f); 81 | DrawBorders(P1, RT1); 82 | 83 | G.DrawLine(P2, 0, 23, Width, 23); 84 | 85 | G.FillRectangle(B1, 0, 24, Width, 13); 86 | 87 | DrawGradient(C4, C5, 0, 24, Width, 6); 88 | 89 | G.DrawLine(P3, 0, 37, Width, 37); 90 | DrawBorders(P4, 1, 38, Width - 2, Height - 39); 91 | 92 | DrawText(B2, HorizontalAlignment.Left, 5, 0); 93 | 94 | DrawBorders(P5); 95 | } 96 | 97 | } 98 | 99 | //------------------ 100 | //Creator: aeonhack 101 | //Site: elitevs.net 102 | //Created: 9/23/2011 103 | //Changed: 9/23/2011 104 | //Version: 1.0.0 105 | //Theme Base: 1.5.2 106 | //------------------ 107 | class FutureButton : ThemeControl152 108 | { 109 | 110 | 111 | private ColorBlend Blend; 112 | public FutureButton() 113 | { 114 | SetColor("Blend1", 28, 28, 28); 115 | SetColor("Blend2", 32, 32, 32); 116 | SetColor("Blend3", 24, 24, 24); 117 | SetColor("Border1A", 40, 40, 40); 118 | SetColor("Border1B", 48, 48, 48); 119 | SetColor("Border2", Color.Black); 120 | SetColor("Border3", 24, 24, 24); 121 | SetColor("Line1", 44, 44, 44); 122 | SetColor("TextShade", Color.Black); 123 | SetColor("Text", Color.White); 124 | SetColor("Corners", 40, 40, 40); 125 | 126 | Blend = new ColorBlend(); 127 | Blend.Positions = new float[] { 128 | 0f, 129 | 0.5f, 130 | 1f 131 | }; 132 | } 133 | 134 | private Pen P1; 135 | private Pen P2; 136 | private Pen P3; 137 | private Pen P4; 138 | private SolidBrush B1; 139 | private SolidBrush B2; 140 | private Color C1; 141 | private Color C2; 142 | 143 | private Color C3; 144 | protected override void ColorHook() 145 | { 146 | C1 = GetColor("Border1A"); 147 | C2 = GetColor("Border1B"); 148 | C3 = GetColor("Corners"); 149 | 150 | P2 = new Pen(GetColor("Border2")); 151 | P3 = new Pen(GetColor("Border3")); 152 | P4 = new Pen(GetColor("Line1")); 153 | 154 | B1 = new SolidBrush(GetColor("TextShade")); 155 | B2 = new SolidBrush(GetColor("Text")); 156 | 157 | Blend.Colors = new Color[] { 158 | GetColor("Blend1"), 159 | GetColor("Blend2"), 160 | GetColor("Blend3") 161 | }; 162 | } 163 | 164 | 165 | private LinearGradientBrush GB1; 166 | protected override void PaintHook() 167 | { 168 | DrawGradient(Blend, ClientRectangle, 90f); 169 | 170 | GB1 = new LinearGradientBrush(ClientRectangle, C1, C2, 90f); 171 | P1 = new Pen(GB1); 172 | 173 | DrawBorders(P1); 174 | DrawBorders(P2, 1); 175 | 176 | if (State == MouseState.Down) 177 | { 178 | DrawBorders(P3, 2); 179 | 180 | DrawText(B1, HorizontalAlignment.Center, 2, 2); 181 | DrawText(B2, HorizontalAlignment.Center, 1, 1); 182 | } 183 | else 184 | { 185 | G.DrawLine(P4, 2, 2, Width - 3, 2); 186 | 187 | DrawText(B1, HorizontalAlignment.Center, 1, 1); 188 | DrawText(B2, HorizontalAlignment.Center, 0, 0); 189 | } 190 | 191 | DrawCorners(C3, 1, 1, Width - 2, Height - 2); 192 | DrawCorners(BackColor); 193 | } 194 | } -------------------------------------------------------------------------------- /Windows Forms Themes/flow_theme_c#.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Drawing; 4 | using System.Drawing.Drawing2D; 5 | using System.ComponentModel; 6 | using System.Windows.Forms; 7 | 8 | 9 | //------------------ 10 | //Creator: aeonhack 11 | //Site: elitevs.net 12 | //Created: 9/23/2011 13 | //Changed: 9/23/2011 14 | //Version: 1.0.0 15 | //Theme Base: 1.5.2 16 | //------------------ 17 | class FlowTheme : ThemeContainer152 18 | { 19 | 20 | public FlowTheme() 21 | { 22 | MoveHeight = 24; 23 | BackColor = Color.FromArgb(35, 35, 35); 24 | TransparencyKey = Color.Fuchsia; 25 | 26 | SetColor("Sides", 40, 40, 40); 27 | SetColor("Gradient", 18, 18, 18); 28 | SetColor("Text", 0, 132, 255); 29 | SetColor("Border1", 40, 40, 40); 30 | SetColor("Border2", 22, 22, 22); 31 | SetColor("Border3", 65, 65, 65); 32 | SetColor("Border4", Color.Black); 33 | SetColor("Hatch1", 39, 39, 39); 34 | SetColor("Hatch2", 35, 35, 35); 35 | SetColor("Hatch3", 29, 29, 29); 36 | SetColor("Hatch4", 26, 26, 26); 37 | SetColor("Shade1", 50, 7, 7, 7); 38 | SetColor("Shade2", Color.Transparent); 39 | } 40 | 41 | private Color C1; 42 | private Color C2; 43 | private SolidBrush B1; 44 | private Pen P1; 45 | private Pen P2; 46 | private Pen P3; 47 | 48 | private Pen P4; 49 | protected override void ColorHook() 50 | { 51 | C1 = GetColor("Sides"); 52 | C2 = GetColor("Gradient"); 53 | 54 | B1 = new SolidBrush(GetColor("Text")); 55 | 56 | P1 = new Pen(GetColor("Border1")); 57 | P2 = new Pen(GetColor("Border2")); 58 | P3 = new Pen(GetColor("Border3")); 59 | P4 = new Pen(GetColor("Border4")); 60 | 61 | CreateTile(); 62 | CreateShade(); 63 | 64 | BackColor = GetColor("Hatch2"); 65 | } 66 | 67 | 68 | private Rectangle RT1; 69 | protected override void PaintHook() 70 | { 71 | G.Clear(C1); 72 | 73 | DrawGradient(C2, C1, 0, 0, Width, 24); 74 | DrawText(B1, HorizontalAlignment.Left, 8, 0); 75 | 76 | RT1 = new Rectangle(8, 24, Width - 16, Height - 32); 77 | G.FillRectangle(Tile, RT1); 78 | 79 | for (int I = 0; I <= Shade.Length - 1; I++) 80 | { 81 | DrawBorders(Shade[I], RT1, I); 82 | } 83 | 84 | RT1 = new Rectangle(8, 24, Width - 16, Height - 32); 85 | DrawBorders(P1, RT1, 1); 86 | DrawBorders(P2, RT1); 87 | DrawCorners(C1, RT1); 88 | 89 | DrawBorders(P3, 1); 90 | DrawBorders(P4); 91 | 92 | DrawCorners(TransparencyKey); 93 | } 94 | 95 | 96 | private TextureBrush Tile; 97 | private byte[] TileData = Convert.FromBase64String("AgIBAQEBAwMBAQEBAAABAQEBAQEBAgIBAQEBAwMBAQEBAAAB"); 98 | private void CreateTile() 99 | { 100 | Bitmap TileImage = new Bitmap(6, 6); 101 | Color[] TileColors = new Color[] { 102 | GetColor("Hatch1"), 103 | GetColor("Hatch2"), 104 | GetColor("Hatch3"), 105 | GetColor("Hatch4") 106 | }; 107 | 108 | for (int I = 0; I <= 35; I++) 109 | { 110 | TileImage.SetPixel(I % 6, I / 6, TileColors[TileData[I]]); 111 | } 112 | 113 | Tile = new TextureBrush(TileImage); 114 | TileImage.Dispose(); 115 | } 116 | 117 | private Pen[] Shade; 118 | private void CreateShade() 119 | { 120 | if (Shade != null) 121 | { 122 | for (int I = 0; I <= Shade.Length - 1; I++) 123 | { 124 | Shade[I].Dispose(); 125 | } 126 | } 127 | 128 | Bitmap ShadeImage = new Bitmap(1, 20); 129 | Graphics ShadeGraphics = Graphics.FromImage(ShadeImage); 130 | 131 | Rectangle ShadeBounds = new Rectangle(0, 0, 1, 20); 132 | LinearGradientBrush Gradient = new LinearGradientBrush(ShadeBounds, GetColor("Shade1"), GetColor("Shade2"), 90f); 133 | 134 | Shade = new Pen[20]; 135 | ShadeGraphics.FillRectangle(Gradient, ShadeBounds); 136 | 137 | for (int I = 0; I <= Shade.Length - 1; I++) 138 | { 139 | Shade[I] = new Pen(ShadeImage.GetPixel(0, I)); 140 | } 141 | 142 | Gradient.Dispose(); 143 | ShadeGraphics.Dispose(); 144 | ShadeImage.Dispose(); 145 | } 146 | 147 | } 148 | 149 | //------------------ 150 | //Creator: aeonhack 151 | //Site: elitevs.net 152 | //Created: 9/23/2011 153 | //Changed: 9/23/2011 154 | //Version: 1.0.0 155 | //Theme Base: 1.5.2 156 | //------------------ 157 | class FlowButton : ThemeControl152 158 | { 159 | 160 | public FlowButton() 161 | { 162 | SetColor("DownGradient1", 24, 24, 24); 163 | SetColor("DownGradient2", 38, 38, 38); 164 | SetColor("NoneGradient1", 38, 38, 38); 165 | SetColor("NoneGradient2", 24, 24, 24); 166 | SetColor("Text", 0, 132, 255); 167 | SetColor("Border1", 22, 22, 22); 168 | SetColor("Border2A", 60, 60, 60); 169 | SetColor("Border2B", 36, 36, 36); 170 | } 171 | 172 | private Color C1; 173 | private Color C2; 174 | private Color C3; 175 | private Color C4; 176 | private Color C5; 177 | private Color C6; 178 | private SolidBrush B1; 179 | private LinearGradientBrush B2; 180 | private Pen P1; 181 | 182 | private Pen P2; 183 | protected override void ColorHook() 184 | { 185 | C1 = GetColor("DownGradient1"); 186 | C2 = GetColor("DownGradient2"); 187 | C3 = GetColor("NoneGradient1"); 188 | C4 = GetColor("NoneGradient2"); 189 | C5 = GetColor("Border2A"); 190 | C6 = GetColor("Border2B"); 191 | 192 | B1 = new SolidBrush(GetColor("Text")); 193 | 194 | P1 = new Pen(GetColor("Border1")); 195 | } 196 | 197 | protected override void PaintHook() 198 | { 199 | if (State == MouseState.Down) 200 | { 201 | DrawGradient(C1, C2, ClientRectangle, 90f); 202 | } 203 | else 204 | { 205 | DrawGradient(C3, C4, ClientRectangle, 90f); 206 | } 207 | 208 | DrawText(B1, HorizontalAlignment.Center, 0, 0); 209 | 210 | B2 = new LinearGradientBrush(ClientRectangle, C5, C6, 90f); 211 | P2 = new Pen(B2); 212 | 213 | DrawBorders(P1); 214 | DrawBorders(P2, 1); 215 | } 216 | } -------------------------------------------------------------------------------- /Windows Forms Themes/drone_theme_c#.cs: -------------------------------------------------------------------------------- 1 | //THIS IS NOT THE FINAL VERSION. 2 | 3 | using System; 4 | using System.Collections; 5 | using System.Drawing; 6 | using System.Drawing.Drawing2D; 7 | using System.ComponentModel; 8 | using System.Windows.Forms; 9 | 10 | //------------------ 11 | //Creator: aeonhack 12 | //Site: elitevs.net 13 | //Created: 9/2/2011 14 | //Changed: 9/2/2011 15 | //Version: 1.0.0 16 | //Theme Base: 1.5.3 17 | //------------------ 18 | internal class DroneTheme : ThemeContainer153 19 | { 20 | public DroneTheme() 21 | { 22 | Header = 24; 23 | TransparencyKey = Color.Fuchsia; 24 | } 25 | 26 | protected override void ColorHook() 27 | { 28 | 29 | } 30 | 31 | protected override void PaintHook() 32 | { 33 | G.Clear(Color.FromArgb(24, 24, 24)); 34 | 35 | DrawGradient(Color.FromArgb(0, 55, 90), Color.FromArgb(0, 70, 128), 11, 8, Width - 22, 17); 36 | G.FillRectangle(new SolidBrush(Color.FromArgb(0, 55, 90)), 11, 3, Width - 22, 5); 37 | 38 | Pen P = new Pen(Color.FromArgb(13, Color.White)); 39 | G.DrawLine(P, 10, 1, 10, Height); 40 | G.DrawLine(P, Width - 11, 1, Width - 11, Height); 41 | G.DrawLine(P, 11, Height - 11, Width - 12, Height - 11); 42 | G.DrawLine(P, 11, 29, Width - 12, 29); 43 | G.DrawLine(P, 11, 25, Width - 12, 25); 44 | 45 | G.FillRectangle(new SolidBrush(Color.FromArgb(13, Color.White)), 0, 2, Width, 6); 46 | G.FillRectangle(new SolidBrush(Color.FromArgb(13, Color.White)), 0, Height - 6, Width, 4); 47 | 48 | G.FillRectangle(new SolidBrush(Color.FromArgb(24, 24, 24)), 11, Height - 6, Width - 22, 4); 49 | 50 | HatchBrush T = new HatchBrush(HatchStyle.Trellis, Color.FromArgb(24, 24, 24), Color.FromArgb(8, 8, 8)); 51 | G.FillRectangle(T, 11, 30, Width - 22, Height - 41); 52 | 53 | DrawText(Brushes.White, HorizontalAlignment.Left, 15, 2); 54 | 55 | DrawBorders(new Pen(Color.FromArgb(58, 58, 58)), 1); 56 | DrawBorders(Pens.Black); 57 | 58 | P = new Pen(Color.FromArgb(25, Color.White)); 59 | G.DrawLine(P, 11, 3, Width - 12, 3); 60 | G.DrawLine(P, 12, 2, 12, 7); 61 | G.DrawLine(P, Width - 13, 2, Width - 13, 7); 62 | 63 | G.DrawLine(Pens.Black, 11, 0, 11, Height); 64 | G.DrawLine(Pens.Black, Width - 12, 0, Width - 12, Height); 65 | 66 | G.DrawRectangle(Pens.Black, 11, 2, Width - 23, 22); 67 | G.DrawLine(Pens.Black, 11, Height - 12, Width - 12, Height - 12); 68 | G.DrawLine(Pens.Black, 11, 30, Width - 12, 30); 69 | 70 | DrawCorners(Color.Fuchsia); 71 | } 72 | 73 | } 74 | 75 | //------------------ 76 | //Creator: aeonhack 77 | //Site: elitevs.net 78 | //Created: 9/2/2011 79 | //Changed: 9/2/2011 80 | //Version: 1.0.0 81 | //Theme Base: 1.5.3 82 | //------------------ 83 | internal class DroneButton : ThemeControl153 84 | { 85 | protected override void ColorHook() 86 | { 87 | 88 | } 89 | 90 | protected override void PaintHook() 91 | { 92 | DrawBorders(new Pen(Color.FromArgb(32, 32, 32)), 1); 93 | G.FillRectangle(new SolidBrush(Color.FromArgb(62, 62, 62)), 0, 0, Width, 8); 94 | DrawBorders(Pens.Black, 2); 95 | DrawBorders(Pens.Black); 96 | 97 | if (State == MouseState.Over) 98 | { 99 | G.FillRectangle(new SolidBrush(Color.FromArgb(0, 55, 90)), 3, 3, Width - 6, Height - 6); 100 | DrawBorders(new Pen(Color.FromArgb(0, 66, 108)), 3); 101 | } 102 | else if (State == MouseState.Down) 103 | { 104 | G.FillRectangle(new SolidBrush(Color.FromArgb(0, 44, 72)), 3, 3, Width - 6, Height - 6); 105 | DrawBorders(new Pen(Color.FromArgb(0, 55, 90)), 3); 106 | } 107 | else 108 | { 109 | G.FillRectangle(new SolidBrush(Color.FromArgb(24, 24, 24)), 3, 3, Width - 6, Height - 6); 110 | DrawBorders(new Pen(Color.FromArgb(38, 38, 38)), 3); 111 | } 112 | 113 | G.FillRectangle(new SolidBrush(Color.FromArgb(13, Color.White)), 3, 3, Width - 6, 8); 114 | 115 | if (State == MouseState.Down) 116 | { 117 | DrawText(Brushes.White, HorizontalAlignment.Center, 1, 1); 118 | } 119 | else 120 | { 121 | DrawText(Brushes.White, HorizontalAlignment.Center, 0, 0); 122 | } 123 | 124 | } 125 | 126 | } 127 | 128 | //------------------ 129 | //Creator: aeonhack 130 | //Site: elitevs.net 131 | //Created: 9/24/2011 132 | //Changed: 9/24/2011 133 | //Version: 1.0.0 134 | //Theme Base: 1.5.3 135 | //------------------ 136 | internal class DroneProgressBar : ThemeControl153 137 | { 138 | private ColorBlend Blend; 139 | 140 | 141 | public DroneProgressBar() 142 | { 143 | Blend = new ColorBlend(); 144 | Blend.Colors = new Color[] {Color.FromArgb(0, 55, 90), Color.FromArgb(0, 66, 108), Color.FromArgb(0, 66, 108), Color.FromArgb(0, 55, 90)}; 145 | Blend.Positions = new float[] {0.0F, 0.4F, 0.6F, 1.0F}; 146 | } 147 | 148 | protected override void OnCreation() 149 | { 150 | if (!DesignMode) 151 | { 152 | System.Threading.Thread T = new System.Threading.Thread(MoveGlow); 153 | T.IsBackground = true; 154 | T.Start(); 155 | } 156 | } 157 | 158 | private float GlowPosition = -1.0F; 159 | private void MoveGlow() 160 | { 161 | while (true) 162 | { 163 | GlowPosition += 0.01F; 164 | if (GlowPosition >= 1.0F) 165 | { 166 | GlowPosition = -1.0F; 167 | } 168 | Invalidate(); 169 | System.Threading.Thread.Sleep(25); 170 | } 171 | } 172 | 173 | private int _Value; 174 | public int Value 175 | { 176 | get 177 | { 178 | return _Value; 179 | } 180 | set 181 | { 182 | if (value > _Maximum) 183 | { 184 | value = _Maximum; 185 | } 186 | if (value < 0) 187 | { 188 | value = 0; 189 | } 190 | 191 | _Value = value; 192 | Invalidate(); 193 | } 194 | } 195 | 196 | private int _Maximum = 100; 197 | public int Maximum 198 | { 199 | get 200 | { 201 | return _Maximum; 202 | } 203 | set 204 | { 205 | if (value < 1) 206 | { 207 | value = 1; 208 | } 209 | if (_Value > value) 210 | { 211 | _Value = value; 212 | } 213 | 214 | _Maximum = value; 215 | Invalidate(); 216 | } 217 | } 218 | 219 | public void Increment(int amount) 220 | { 221 | Value += amount; 222 | } 223 | 224 | protected override void ColorHook() 225 | { 226 | 227 | } 228 | 229 | private int Progress; 230 | protected override void PaintHook() 231 | { 232 | DrawBorders(new Pen(Color.FromArgb(32, 32, 32)), 1); 233 | G.FillRectangle(new SolidBrush(Color.FromArgb(50, 50, 50)), 0, 0, Width, 8); 234 | 235 | DrawGradient(Color.FromArgb(8, 8, 8), Color.FromArgb(23, 23, 23), 2, 2, Width - 4, Height - 4, 90.0F); 236 | 237 | Progress = Convert.ToInt32((_Value / (double)_Maximum) * Width); 238 | 239 | if (!(Progress == 0)) 240 | { 241 | G.SetClip(new Rectangle(3, 3, Progress - 6, Height - 6)); 242 | G.FillRectangle(new SolidBrush(Color.FromArgb(0, 55, 90)), 0, 0, Progress, Height); 243 | 244 | DrawGradient(Blend, Convert.ToInt32(GlowPosition * Progress), 0, Progress, Height, 0.0F); 245 | DrawBorders(new Pen(Color.FromArgb(15, Color.White)), 3, 3, Progress - 6, Height - 6); 246 | 247 | G.FillRectangle(new SolidBrush(Color.FromArgb(13, Color.White)), 3, 3, Width - 6, 5); 248 | 249 | G.ResetClip(); 250 | } 251 | 252 | DrawBorders(Pens.Black, 2); 253 | DrawBorders(Pens.Black); 254 | } 255 | } 256 | 257 | //------------------ 258 | //Creator: aeonhack 259 | //Site: elitevs.net 260 | //Created: 10/25/2011 261 | //Changed: 10/25/2011 262 | //Version: 1.0.0 263 | //Theme Base: 1.5.3 264 | //------------------ 265 | internal class DroneGroupBox : ThemeContainer153 266 | { 267 | public DroneGroupBox() 268 | { 269 | ControlMode = true; 270 | Header = 26; 271 | } 272 | 273 | protected override void ColorHook() 274 | { 275 | 276 | } 277 | 278 | protected override void PaintHook() 279 | { 280 | G.Clear(Color.FromArgb(24, 24, 24)); 281 | 282 | DrawGradient(Color.FromArgb(0, 55, 90), Color.FromArgb(0, 70, 128), 5, 5, Width - 10, 26); 283 | G.DrawLine(new Pen(Color.FromArgb(20, Color.White)), 7, 7, Width - 8, 7); 284 | 285 | DrawBorders(Pens.Black, 5, 5, Width - 10, 26, 1); 286 | DrawBorders(new Pen(Color.FromArgb(36, 36, 36)), 5, 5, Width - 10, 26); 287 | 288 | //??? 289 | DrawBorders(new Pen(Color.FromArgb(8, 8, 8)), 5, 34, Width - 10, Height - 39, 1); 290 | DrawBorders(new Pen(Color.FromArgb(36, 36, 36)), 5, 34, Width - 10, Height - 39); 291 | 292 | DrawBorders(new Pen(Color.FromArgb(36, 36, 36)), 1); 293 | DrawBorders(Pens.Black); 294 | 295 | G.DrawLine(new Pen(Color.FromArgb(48, 48, 48)), 1, 1, Width - 2, 1); 296 | 297 | DrawText(Brushes.White, HorizontalAlignment.Left, 9, 5); 298 | } 299 | } 300 | 301 | //------------------ 302 | //Creator: aeonhack 303 | //Site: elitevs.net 304 | //Created: 10/25/2011 305 | //Changed: 10/25/2011 306 | //Version: 1.0.0 307 | //Theme Base: 1.5.3 308 | //------------------ 309 | internal class DroneSeperator : ThemeControl153 310 | { 311 | private Orientation _Orientation; 312 | public Orientation Orientation 313 | { 314 | get 315 | { 316 | return _Orientation; 317 | } 318 | set 319 | { 320 | _Orientation = value; 321 | 322 | if (value == System.Windows.Forms.Orientation.Vertical) 323 | { 324 | LockHeight = 0; 325 | LockWidth = 14; 326 | } 327 | else 328 | { 329 | LockHeight = 14; 330 | LockWidth = 0; 331 | } 332 | 333 | Invalidate(); 334 | } 335 | } 336 | 337 | public DroneSeperator() 338 | { 339 | Transparent = true; 340 | BackColor = Color.Transparent; 341 | 342 | LockHeight = 14; 343 | } 344 | 345 | protected override void ColorHook() 346 | { 347 | 348 | } 349 | 350 | protected override void PaintHook() 351 | { 352 | G.Clear(BackColor); 353 | 354 | ColorBlend BL1 = new ColorBlend(); 355 | ColorBlend BL2 = new ColorBlend(); 356 | BL1.Positions = new float[] {0.0F, 0.15F, 0.85F, 1.0F}; 357 | BL2.Positions = new float[] {0.0F, 0.15F, 0.5F, 0.85F, 1.0F}; 358 | 359 | BL1.Colors = new Color[] {Color.Transparent, Color.Black, Color.Black, Color.Transparent}; 360 | BL2.Colors = new Color[] {Color.Transparent, Color.FromArgb(35, 35, 35), Color.FromArgb(45, 45, 45), Color.FromArgb(35, 35, 35), Color.Transparent}; 361 | 362 | if (_Orientation == System.Windows.Forms.Orientation.Vertical) 363 | { 364 | DrawGradient(BL1, 6, 0, 1, Height); 365 | DrawGradient(BL2, 7, 0, 1, Height); 366 | } 367 | else 368 | { 369 | DrawGradient(BL1, 0, 6, Width, 1, 0.0F); 370 | DrawGradient(BL2, 0, 7, Width, 1, 0.0F); 371 | } 372 | 373 | } 374 | 375 | } -------------------------------------------------------------------------------- /Windows Forms Themes/modern_theme_c#.cs: -------------------------------------------------------------------------------- 1 | //theme base 1.5.2 2 | using System; 3 | using System.Drawing; 4 | using System.Drawing.Drawing2D; 5 | using System.Windows.Forms; 6 | 7 | public class ModernTheme : Control { 8 | public ModernTheme() { 9 | ForeColor = Color.FromArgb(50, 210, 50); 10 | } 11 | 12 | private int _TitleHeight = 25; 13 | public int TitleHeight { 14 | get { return _TitleHeight; } 15 | set { 16 | if (value > Height) { 17 | value = Height; 18 | } 19 | if (value < 2) { 20 | Height = 1; 21 | } 22 | _TitleHeight = value; 23 | Invalidate(); 24 | } 25 | } 26 | private HorizontalAlignment _TitleAlign = (HorizontalAlignment)2; 27 | 28 | public HorizontalAlignment TitleAlign { 29 | get { return _TitleAlign; } 30 | set { 31 | _TitleAlign = value; 32 | Invalidate(); 33 | } 34 | } 35 | 36 | protected override void OnHandleCreated(System.EventArgs e) { 37 | Dock = (DockStyle)5; 38 | if (Parent is Form) 39 | ((Form)Parent).FormBorderStyle = 0; 40 | base.OnHandleCreated(e); 41 | } 42 | 43 | protected override void OnMouseDown(System.Windows.Forms.MouseEventArgs e) { 44 | if (new Rectangle(Parent.Location.X, Parent.Location.Y, Width - 1, _TitleHeight - 1).IntersectsWith(new Rectangle(MousePosition.X, MousePosition.Y, 1, 1))) { 45 | Capture = false; 46 | var M = Message.Create(Parent.Handle, 161, new IntPtr(2), new IntPtr(0)); 47 | DefWndProc(ref M); 48 | } 49 | base.OnMouseDown(e); 50 | } 51 | 52 | private Color C1 = Color.FromArgb(74, 74, 74); 53 | private Color C2 = Color.FromArgb(63, 63, 63); 54 | private Color C3 = Color.FromArgb(41, 41, 41); 55 | private Color C4 = Color.FromArgb(27, 27, 27); 56 | private Color C5 = Color.FromArgb(0, 0, 0, 0); 57 | private Color C6 = Color.FromArgb(25, 255, 255, 255); 58 | 59 | protected override void OnPaintBackground(System.Windows.Forms.PaintEventArgs pevent) { } 60 | 61 | protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) { 62 | using (Bitmap B = new Bitmap(Width, Height)) { 63 | using (var G = Graphics.FromImage(B)) { 64 | G.Clear(C3); 65 | Draw.Gradient(G, C4, C3, 0, 0, Width, _TitleHeight); 66 | 67 | G.DrawString(Text, Font, new SolidBrush(ForeColor), 6, 6); 68 | 69 | G.DrawLine(new Pen(C3), 0, 1, Width, 1); 70 | Draw.Blend(G, C5, C6, C5, 0.5F, 0, 0, _TitleHeight + 1, Width, 1); 71 | G.DrawLine(new Pen(C4), 0, _TitleHeight, Width, _TitleHeight); 72 | G.DrawRectangle(new Pen(C4), 0, 0, Width - 1, Height - 1); 73 | e.Graphics.DrawImage((Image)B.Clone(), (float)0, (float)0); 74 | } 75 | } 76 | } 77 | } 78 | 79 | public class MCheckBox : Control { 80 | public MCheckBox() { 81 | ForeColor = Color.FromArgb(50, 210, 50); 82 | } 83 | private bool _checked; 84 | public bool Checked { 85 | get { return _checked; } 86 | set { 87 | _checked = value; 88 | Invalidate(); 89 | } 90 | } 91 | 92 | private int State; 93 | protected override void OnMouseEnter(System.EventArgs e) { 94 | State = 1; 95 | Invalidate(); 96 | base.OnMouseEnter(e); 97 | } 98 | 99 | protected override void OnMouseDown(System.Windows.Forms.MouseEventArgs e) { 100 | State = 2; 101 | Invalidate(); 102 | base.OnMouseDown(e); 103 | } 104 | 105 | protected override void OnMouseLeave(System.EventArgs e) { 106 | State = 0; 107 | Invalidate(); 108 | base.OnMouseLeave(e); 109 | } 110 | 111 | protected override void OnMouseUp(System.Windows.Forms.MouseEventArgs e) { 112 | State = 1; 113 | Invalidate(); 114 | base.OnMouseUp(e); 115 | } 116 | 117 | protected override void OnClick(System.EventArgs e) { 118 | _checked = !_checked; 119 | } 120 | 121 | private Color C1 = Color.FromArgb(31, 31, 31); 122 | private Color C2 = Color.FromArgb(41, 41, 41); 123 | private Color C3 = Color.FromArgb(51, 51, 51); 124 | private Color C4 = Color.FromArgb(0, 0, 0, 0); 125 | private Color C5 = Color.FromArgb(25, 255, 255, 255); 126 | 127 | protected override void OnPaintBackground(System.Windows.Forms.PaintEventArgs pevent) { } 128 | 129 | protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) { 130 | 131 | using (Bitmap B = new Bitmap(Width, Height)) { 132 | using (var G = Graphics.FromImage(B)) { 133 | 134 | G.Clear(Color.FromArgb(41, 41, 41)); 135 | 136 | int BWidth = 15, BHeight = 14; 137 | 138 | if (State == 1 && _checked) { 139 | G.DrawRectangle(new Pen(C2), 1, 1, BWidth - 3, BHeight); 140 | Draw.Gradient(G, Color.FromArgb(0, 120, 0), Color.FromArgb(0, 110, 0), 1, 1, BWidth - 2, BHeight); 141 | G.DrawRectangle(new Pen(C1), 0, 0, BWidth - 1, BHeight); 142 | } 143 | else if (State == 2 && _checked) { 144 | G.DrawRectangle(new Pen(C2), 1, 1, BWidth - 3, BHeight - 3); 145 | Draw.Gradient(G, Color.FromArgb(0, 100, 0), Color.FromArgb(0, 90, 0), 1, 1, BWidth - 2, BHeight); 146 | G.DrawRectangle(new Pen(C1), 0, 0, BWidth - 1, BHeight); 147 | } 148 | else if (State == 1 && !_checked) { 149 | G.DrawRectangle(new Pen(C2), 1, 1, BWidth - 3, BHeight - 3); 150 | Draw.Gradient(G, Color.FromArgb(120, 0, 0), Color.FromArgb(110, 0, 0), 1, 1, BWidth - 2, BHeight); 151 | G.DrawRectangle(new Pen(C1), 0, 0, BWidth - 1, BHeight); 152 | } 153 | else if (State == 2 && !_checked) { 154 | G.DrawRectangle(new Pen(C2), 1, 1, BWidth - 3, BHeight - 3); 155 | Draw.Gradient(G, Color.FromArgb(100, 0, 0), Color.FromArgb(90, 0, 0), 1, 1, BWidth - 2, BHeight); 156 | G.DrawRectangle(new Pen(C1), 0, 0, BWidth - 1, BHeight); 157 | } 158 | else if (_checked) { 159 | G.DrawRectangle(new Pen(C2), 1, 1, BWidth - 3, BHeight - 3); 160 | Draw.Gradient(G, Color.FromArgb(0, 110, 0), Color.FromArgb(0, 100, 0), 1, 1, BWidth - 2, BHeight); 161 | G.DrawRectangle(new Pen(C1), 0, 0, BWidth - 1, BHeight); 162 | } 163 | else if (!_checked) { 164 | G.DrawRectangle(new Pen(C2), 1, 1, BWidth - 3, BHeight - 3); 165 | Draw.Gradient(G, Color.FromArgb(110, 0, 0), Color.FromArgb(100, 0, 0), 1, 1, BWidth - 2, BHeight); 166 | G.DrawRectangle(new Pen(C1), 0, 0, BWidth - 1, BHeight); 167 | } 168 | G.DrawString(Text, Font, new SolidBrush(ForeColor), 16, 1); 169 | e.Graphics.DrawImage((Image)B.Clone(), 0, 0); 170 | } 171 | } 172 | } 173 | } 174 | 175 | public class MGroupBox : Control { 176 | 177 | public MGroupBox() { 178 | ForeColor = Color.FromArgb(50, 210, 50); 179 | } 180 | 181 | private Color C1 = Color.FromArgb(31, 31, 31); 182 | private Color C2 = Color.FromArgb(41, 41, 41); 183 | private Color C3 = Color.FromArgb(51, 51, 51); 184 | 185 | protected override void OnPaintBackground(System.Windows.Forms.PaintEventArgs pevent) { } 186 | 187 | protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) { 188 | using (Bitmap B = new Bitmap(Width, Height)) { 189 | using (var G = Graphics.FromImage(B)) { 190 | 191 | Draw.Gradient(G, C3, C2, 1, 1, Width - 2, 20); 192 | G.FillRectangle(new SolidBrush(C2), new Rectangle(1, 21, Width - 1, Height - 1)); 193 | 194 | G.DrawString(Text, Font, new SolidBrush(ForeColor), 5 , 4); 195 | 196 | G.DrawRectangle(new Pen(C1), 0, 0, Width - 1, Height - 1); 197 | G.DrawLine(new Pen(C1), 0, 21, Width, 21); 198 | 199 | e.Graphics.DrawImage((Image)B.Clone(), (float)0, (float)0); 200 | } 201 | } 202 | } 203 | } 204 | 205 | 206 | 207 | public class MButton : Control { 208 | public MButton() { 209 | ForeColor = Color.FromArgb(50, 210, 50); 210 | } 211 | 212 | private int State; 213 | protected override void OnMouseEnter(System.EventArgs e) { 214 | State = 1; 215 | Invalidate(); 216 | base.OnMouseEnter(e); 217 | } 218 | 219 | protected override void OnMouseDown(System.Windows.Forms.MouseEventArgs e) { 220 | State = 2; 221 | Invalidate(); 222 | base.OnMouseDown(e); 223 | } 224 | 225 | protected override void OnMouseLeave(System.EventArgs e) { 226 | State = 0; 227 | Invalidate(); 228 | base.OnMouseLeave(e); 229 | } 230 | 231 | protected override void OnMouseUp(System.Windows.Forms.MouseEventArgs e) { 232 | State = 1; 233 | Invalidate(); 234 | base.OnMouseUp(e); 235 | } 236 | 237 | private Color C1 = Color.FromArgb(31, 31, 31); 238 | private Color C2 = Color.FromArgb(41, 41, 41); 239 | private Color C3 = Color.FromArgb(51, 51, 51); 240 | private Color C4 = Color.FromArgb(0, 0, 0, 0); 241 | private Color C5 = Color.FromArgb(25, 255, 255, 255); 242 | 243 | protected override void OnPaintBackground(System.Windows.Forms.PaintEventArgs pevent) { } 244 | 245 | protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) { 246 | using (Bitmap B = new Bitmap(Width, Height)) { 247 | using (var G = Graphics.FromImage(B)) { 248 | G.DrawRectangle(new Pen(C1), 0, 0, Width - 1, Height - 1); 249 | 250 | if (State == 2) 251 | Draw.Gradient(G, C2, C3, 1, 1, Width - 2, Height - 2); 252 | else 253 | Draw.Gradient(G, C3, C2, 1, 1, Width - 2, Height - 2); 254 | 255 | var O = G.MeasureString(Text, Font); 256 | G.DrawString(Text, Font, new SolidBrush(ForeColor), Width / 2 - O.Width / 2, Height / 2 - O.Height / 2 + 1); 257 | Draw.Blend(G, C4, C5, C4, 0.5F, 0, 1, 1, Width - 2, 1); 258 | e.Graphics.DrawImage((Image)B.Clone(), (float)0, (float)0); 259 | } 260 | } 261 | } 262 | } 263 | 264 | public class MProgress : Control { 265 | 266 | private bool _percent; 267 | public bool ShowPercent { 268 | get { return _percent; } 269 | set { _percent = value; } 270 | } 271 | 272 | private int _Maximum = 100; 273 | public int Maximum { 274 | get { return _Maximum; } 275 | set { 276 | if (value == 0) 277 | value = 1; 278 | _Maximum = value; 279 | Invalidate(); 280 | } 281 | } 282 | 283 | private int _Value; 284 | public int Value { 285 | get { return _Value; } 286 | set { 287 | _Value = value; 288 | Invalidate(); 289 | } 290 | } 291 | 292 | public MProgress() { 293 | ForeColor = Color.FromArgb(50, 210, 50); 294 | Height = 18; 295 | } 296 | 297 | private Color C1 = Color.FromArgb(31, 31, 31); 298 | private Color C2 = Color.FromArgb(41, 41, 41); 299 | private Color C3 = Color.FromArgb(51, 51, 51); 300 | private Color C4 = Color.FromArgb(0, 0, 0, 0); 301 | private Color C5 = Color.FromArgb(25, 255, 255, 255); 302 | 303 | protected override void OnPaintBackground(System.Windows.Forms.PaintEventArgs pevent) { } 304 | 305 | protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) { 306 | int V = Width * _Value / _Maximum; 307 | using (Bitmap B = new Bitmap(Width, Height)) { 308 | using (var G = Graphics.FromImage(B)) { 309 | Draw.Gradient(G, C2, C3, 1, 1, Width - 2, Height - 2); 310 | G.DrawRectangle(new Pen(C2), 1, 1, V - 3, Height - 3); 311 | Draw.Gradient(G, C3, C2, 2, 2, V - 4, Height - 4); 312 | G.DrawRectangle(new Pen(C1), 0, 0, Width - 1, Height - 1); 313 | if (_percent) { 314 | string _spercent = (100 * _Value / _Maximum).ToString() + "%"; 315 | var O = G.MeasureString(_spercent, Font); 316 | G.DrawString(_spercent, Font, new SolidBrush(ForeColor), new PointF(Width / 2 - O.Width / 2, Height / 2 - O.Height / 2 + 1)); 317 | } 318 | e.Graphics.DrawImage((Image)B.Clone(), 0, 0); 319 | } 320 | } 321 | } 322 | } 323 | 324 | class MComboBox : ComboBox { 325 | 326 | private Color C1 = Color.FromArgb(31, 31, 31); 327 | private Color C2 = Color.FromArgb(41, 41, 41); 328 | private Color C3 = Color.FromArgb(51, 51, 51); 329 | private Color C4 = Color.FromArgb(0, 0, 0, 0); 330 | private Color C5 = Color.FromArgb(25, 255, 255, 255); 331 | 332 | private int X; 333 | public MComboBox() 334 | : base() { 335 | ForeColor = Color.FromArgb(50, 210, 50); 336 | TextChanged += GhostCombo_TextChanged; 337 | DropDownClosed += GhostComboBox_DropDownClosed; 338 | SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.ResizeRedraw | ControlStyles.UserPaint | ControlStyles.DoubleBuffer, true); 339 | DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; 340 | ItemHeight = 20; 341 | BackColor = Color.FromArgb(30, 30, 30); 342 | DropDownStyle = ComboBoxStyle.DropDownList; 343 | } 344 | 345 | protected override void OnMouseMove(System.Windows.Forms.MouseEventArgs e) { 346 | base.OnMouseMove(e); 347 | X = e.X; 348 | Invalidate(); 349 | } 350 | 351 | protected override void OnMouseLeave(System.EventArgs e) { 352 | base.OnMouseLeave(e); 353 | X = -1; 354 | Invalidate(); 355 | } 356 | 357 | protected override void OnPaint(PaintEventArgs e) { 358 | if (!(DropDownStyle == ComboBoxStyle.DropDownList)) 359 | DropDownStyle = ComboBoxStyle.DropDownList; 360 | Bitmap B = new Bitmap(Width, Height); 361 | Graphics G = Graphics.FromImage(B); 362 | 363 | G.Clear(Color.FromArgb(50, 50, 50)); 364 | LinearGradientBrush GradientBrush = new LinearGradientBrush(new Rectangle(0, 0, Width, Height / 5 * 2), Color.FromArgb(20, 0, 0, 0), Color.FromArgb(15, Color.White), 90f); 365 | 366 | G.DrawRectangle(new Pen(C1), 0, 0, Width - 1, Height - 1); 367 | Draw.Gradient(G, C3, C2, 1, 1, Width - 2, Height - 2); 368 | 369 | int S1 = (int)G.MeasureString("...", Font).Height; 370 | if (SelectedIndex != -1) { 371 | G.DrawString(Items[SelectedIndex].ToString(), Font, new SolidBrush(ForeColor), 4, Height / 2 - S1 / 2); 372 | } 373 | else { 374 | if ((Items != null) & Items.Count > 0) { 375 | G.DrawString(Items[0].ToString(), Font, new SolidBrush(ForeColor), 4, Height / 2 - S1 / 2); 376 | } 377 | else { 378 | G.DrawString("...", Font, new SolidBrush(ForeColor), 4, Height / 2 - S1 / 2); 379 | } 380 | } 381 | 382 | if (MouseButtons == System.Windows.Forms.MouseButtons.None & X >= Width - 25 || 383 | MouseButtons == System.Windows.Forms.MouseButtons.None & X <= Width - 25 & X >= 0) { 384 | G.FillRectangle(new SolidBrush(Color.FromArgb(7, Color.White)), Width - 25, 1, Width - 25, Height - 3); 385 | G.FillRectangle(new SolidBrush(Color.FromArgb(7, Color.White)), 2, 1, Width - 27, Height - 3); 386 | } 387 | 388 | G.FillPolygon(Brushes.Black, Triangle(new Point(Width - 14, Height / 2), new Size(5, 3))); 389 | G.FillPolygon(Brushes.White, Triangle(new Point(Width - 15, Height / 2 - 1), new Size(5, 3))); 390 | 391 | e.Graphics.DrawImage(B, 0, 0); 392 | G.Dispose(); 393 | B.Dispose(); 394 | } 395 | 396 | protected override void OnDrawItem(DrawItemEventArgs e) { 397 | if (e.Index < 0) 398 | return; 399 | Rectangle rect = new Rectangle(); 400 | rect.X = e.Bounds.X; 401 | rect.Y = e.Bounds.Y; 402 | rect.Width = e.Bounds.Width - 1; 403 | rect.Height = e.Bounds.Height - 1; 404 | 405 | e.DrawBackground(); 406 | if ((int)e.State == 785 | (int)e.State == 17) { 407 | Rectangle x2 = new Rectangle(e.Bounds.Location, new Size(e.Bounds.Width, e.Bounds.Height)); 408 | Rectangle x3 = new Rectangle(x2.Location, new Size(x2.Width, (x2.Height / 2) - 1)); 409 | LinearGradientBrush G1 = new LinearGradientBrush(new Point(x2.X, x2.Y), new Point(x2.X, x2.Y + x2.Height), Color.FromArgb(60, 60, 60), Color.FromArgb(50, 50, 50)); 410 | e.Graphics.FillRectangle(G1, x2); 411 | G1.Dispose(); 412 | e.Graphics.DrawString(" " + Items[e.Index].ToString(), Font, new SolidBrush(ForeColor), e.Bounds.X, e.Bounds.Y + 2); 413 | } 414 | else { 415 | e.Graphics.FillRectangle(new SolidBrush(BackColor), e.Bounds); 416 | e.Graphics.DrawString(" " + Items[e.Index].ToString(), Font, new SolidBrush(ForeColor), e.Bounds.X, e.Bounds.Y + 2); 417 | } 418 | base.OnDrawItem(e); 419 | } 420 | 421 | public Point[] Triangle(Point Location, Size Size) { 422 | Point[] ReturnPoints = new Point[4]; 423 | ReturnPoints[0] = Location; 424 | ReturnPoints[1] = new Point(Location.X + Size.Width, Location.Y); 425 | ReturnPoints[2] = new Point(Location.X + Size.Width / 2, Location.Y + Size.Height); 426 | ReturnPoints[3] = Location; 427 | 428 | return ReturnPoints; 429 | } 430 | 431 | private void GhostComboBox_DropDownClosed(object sender, System.EventArgs e) { 432 | DropDownStyle = ComboBoxStyle.Simple; 433 | Application.DoEvents(); 434 | DropDownStyle = ComboBoxStyle.DropDownList; 435 | } 436 | 437 | private void GhostCombo_TextChanged(object sender, System.EventArgs e) { 438 | Invalidate(); 439 | } 440 | } 441 | 442 | public class Draw { 443 | public static void Gradient(Graphics g, Color c1, Color c2, int x, int y, int width, int height) { 444 | Rectangle R = new Rectangle(x, y, width, height); 445 | using (LinearGradientBrush T = new LinearGradientBrush(R, c1, c2, LinearGradientMode.Vertical)) { 446 | g.FillRectangle(T, R); 447 | } 448 | } 449 | public static void Blend(Graphics g, Color c1, Color c2, Color c3, float c, int d, int x, int y, int width, int height) { 450 | ColorBlend V = new ColorBlend(3); 451 | V.Colors = new Color[] { c1, c2, c3 }; 452 | V.Positions = new float[] { 0F, c, 1F }; 453 | Rectangle R = new Rectangle(x, y, width, height); 454 | using (LinearGradientBrush T = new LinearGradientBrush(R, c1, c1, (LinearGradientMode)d)) { 455 | T.InterpolationColors = V; 456 | g.FillRectangle(T, R); 457 | } 458 | } 459 | } -------------------------------------------------------------------------------- /Windows Forms Themes/EasyColour.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel; 3 | using System.Drawing; 4 | using System.Drawing.Drawing2D; 5 | using System.Drawing.Text; 6 | using System.Runtime.InteropServices; 7 | using System.Windows.Forms; 8 | 9 | /*-------------------------*/ 10 | //Theme: EasyColour 11 | //Creator: Euras 12 | //Version: 1.0 13 | //Created: 02/08/14 14 | //Website: eurashd.com 15 | /*-------------------------*/ 16 | 17 | namespace EasyColour 18 | { 19 | class EC_Theme : ContainerControl 20 | { 21 | [DllImportAttribute("user32.dll")] 22 | public static extern int SendMessage(IntPtr hWnd, int Msg, int wParam, int lParam); 23 | [DllImportAttribute("user32.dll")] 24 | public static extern bool ReleaseCapture(); 25 | public const int WM_NCLBUTTONDOWN = 0xA1; 26 | public const int HT_CAPTION = 0x2; 27 | 28 | protected override sealed void OnHandleCreated(EventArgs e) 29 | { 30 | base.Dock = DockStyle.Fill; 31 | ForeColor = Color.White; 32 | base.OnHandleCreated(e); 33 | } 34 | 35 | private bool _IsParentForm; 36 | protected bool IsParentForm 37 | { 38 | get { return _IsParentForm; } 39 | } 40 | 41 | private bool _Transparent; 42 | public bool Transparent 43 | { 44 | get { return _Transparent; } 45 | set 46 | { 47 | _Transparent = value; 48 | if (!(IsHandleCreated)) 49 | return; 50 | 51 | SetStyle(ControlStyles.Opaque, !value); 52 | SetStyle(ControlStyles.SupportsTransparentBackColor, value); 53 | Invalidate(); 54 | } 55 | } 56 | 57 | protected override sealed void OnParentChanged(EventArgs e) 58 | { 59 | base.OnParentChanged(e); 60 | 61 | if (Parent == null) 62 | return; 63 | _IsParentForm = Parent is Form; 64 | 65 | if (_IsParentForm) 66 | { 67 | ParentForm.FormBorderStyle = _BorderStyle; 68 | } 69 | Parent.BackColor = BackColor; 70 | } 71 | 72 | private FormBorderStyle _BorderStyle; 73 | public FormBorderStyle BorderStyle 74 | { 75 | get 76 | { 77 | if (_IsParentForm) 78 | return ParentForm.FormBorderStyle; 79 | else 80 | return _BorderStyle; 81 | } 82 | set 83 | { 84 | _BorderStyle = value; 85 | if (_IsParentForm) 86 | { 87 | ParentForm.FormBorderStyle = value; 88 | } 89 | } 90 | } 91 | 92 | protected override CreateParams CreateParams 93 | { 94 | get 95 | { 96 | const int CS_DROPSHADOW = 0x20000; 97 | CreateParams cp = base.CreateParams; 98 | cp.ClassStyle |= CS_DROPSHADOW; 99 | return cp; 100 | } 101 | } 102 | 103 | protected override void OnMouseDown(MouseEventArgs e) 104 | { 105 | if (e.Button == MouseButtons.Left) 106 | { 107 | ReleaseCapture(); 108 | SendMessage(Parent.Handle, WM_NCLBUTTONDOWN, HT_CAPTION, 0); 109 | } 110 | base.OnMouseDown(e); 111 | } 112 | 113 | protected override void OnPaint(PaintEventArgs e) 114 | { 115 | base.OnPaint(e); 116 | Graphics g = e.Graphics; 117 | g.SmoothingMode = SmoothingMode.HighQuality; 118 | g.InterpolationMode = InterpolationMode.HighQualityBicubic; 119 | g.TextRenderingHint = TextRenderingHint.ClearTypeGridFit; 120 | 121 | g.FillRectangle(new SolidBrush(Color.FromArgb(75, 0, 0, 0)), new Rectangle(-1, -1, Width + 1, 25)); 122 | Image icon = Properties.Resources.icon; 123 | Size iSize = new Size(16, 16); 124 | g.DrawImage(icon, 5, 5, 16, 16); 125 | g.DrawString(Text, Font, new SolidBrush(ForeColor), new Point(25, 5), StringFormat.GenericDefault); 126 | 127 | g.Dispose(); 128 | } 129 | } 130 | 131 | class EC_Button : Control 132 | { 133 | bool isHover; 134 | string _ButtonText; 135 | Image _Image; 136 | Size _ImageSize; 137 | 138 | // Initilize Button 139 | public EC_Button() 140 | { 141 | SetStyle(ControlStyles.SupportsTransparentBackColor, true); 142 | BackColor = Color.Transparent; 143 | Cursor = Cursors.Hand; 144 | } 145 | 146 | // Mouse Hover Events 147 | protected override void OnMouseEnter(EventArgs e) 148 | { 149 | base.OnMouseEnter(e); 150 | isHover = true; 151 | Invalidate(); 152 | } 153 | 154 | protected override void OnMouseLeave(EventArgs e) 155 | { 156 | base.OnMouseLeave(e); 157 | isHover = false; 158 | Invalidate(); 159 | } 160 | 161 | // Button Text Property 162 | [Category("Appearance")] 163 | public override string Text 164 | { 165 | get { return _ButtonText; } 166 | set { _ButtonText = value; } 167 | } 168 | 169 | // Button Image Property 170 | [Category("Appearance")] 171 | public Image Image 172 | { 173 | get { return _Image; } 174 | set { _Image = value; } 175 | } 176 | 177 | // Image Size Property 178 | [Category("Appearance")] 179 | public Size ImageSize 180 | { 181 | get { return _ImageSize; } 182 | set { _ImageSize = value; } 183 | } 184 | 185 | protected override void OnPaint(PaintEventArgs e) 186 | { 187 | base.OnPaint(e); 188 | Graphics g = e.Graphics; 189 | g.InterpolationMode = InterpolationMode.HighQualityBicubic; 190 | 191 | SizeF s = g.MeasureString(_ButtonText, Font); 192 | int x = ClientSize.Width; 193 | int y = ClientSize.Height; 194 | 195 | // Top / Bottom Fills 196 | g.FillRectangle(new SolidBrush(Color.FromArgb(120, 0, 0, 0)), new Rectangle(0, y / 2, x - 1, y - 1)); 197 | g.FillRectangle(new SolidBrush(Color.FromArgb(80, 0, 0, 0)), new Rectangle(0, 0, x - 1, y / 2)); 198 | 199 | if (Text == null) 200 | { 201 | _ButtonText = Name; 202 | } 203 | 204 | // Draw Button Text 205 | g.DrawString(_ButtonText, Font, new SolidBrush(Color.White), (x - s.Width) / 2, (y - s.Height) / 2); 206 | 207 | // Apply Button Image 208 | if (_Image != null) 209 | { 210 | int imgX = _ImageSize.Width; 211 | int imgY = _ImageSize.Height; 212 | 213 | if (_ImageSize != null) 214 | { 215 | g.DrawImage(_Image, 5, (y - imgY) / 2, imgX, imgY); 216 | } 217 | else 218 | { 219 | g.DrawImage(_Image, 5, (y - imgY) / 2, 16, 16); 220 | } 221 | } 222 | 223 | // Button Hover Overlay 224 | if (isHover) 225 | { 226 | g.FillRectangle(new SolidBrush(Color.FromArgb(25, 0, 0, 0)), new Rectangle(0, 0, x, y)); 227 | } 228 | 229 | g.Dispose(); 230 | } 231 | } 232 | 233 | class EC_CheckBox : Control 234 | { 235 | bool _Checked; 236 | 237 | // Initialize Checkbox 238 | public EC_CheckBox() 239 | { 240 | SetStyle(ControlStyles.SupportsTransparentBackColor, true); 241 | BackColor = Color.Transparent; 242 | Size = new Size(20, 20); 243 | MaximumSize = Size; 244 | MinimumSize = Size; 245 | Cursor = Cursors.Hand; 246 | } 247 | 248 | // "Check" Events 249 | protected override void OnMouseClick(MouseEventArgs e) 250 | { 251 | if (_Checked) 252 | { 253 | _Checked = false; 254 | } 255 | else if (!_Checked) 256 | { 257 | _Checked = true; 258 | } 259 | Invalidate(); 260 | base.OnMouseClick(e); 261 | } 262 | 263 | public bool Checked 264 | { 265 | get { return _Checked; } 266 | set { _Checked = value; } 267 | } 268 | 269 | protected override void OnPaint(PaintEventArgs e) 270 | { 271 | base.OnPaint(e); 272 | Graphics g = e.Graphics; 273 | g.SmoothingMode = SmoothingMode.HighQuality; 274 | g.InterpolationMode = InterpolationMode.HighQualityBicubic; 275 | int x = ClientSize.Width; 276 | int y = ClientSize.Height; 277 | 278 | // Fill Outer / Inner Box 279 | g.FillEllipse(new SolidBrush(Color.FromArgb(25, 0, 0, 0)), new Rectangle(0, 0, x - 1, y - 1)); 280 | g.FillEllipse(new SolidBrush(Color.FromArgb(75, 255, 255, 255)), new Rectangle(3, 3, x - 7, y - 7)); 281 | 282 | // Apply Check Overlay 283 | if (_Checked) 284 | { 285 | g.FillEllipse(new SolidBrush(Color.FromArgb(100, 0, 0, 0)), new RectangleF(5, 5, (x / 2) - 1, (y / 2) - 1)); 286 | } 287 | 288 | g.Dispose(); 289 | } 290 | } 291 | 292 | class EC_Panel : Panel 293 | { 294 | public string _PanelText; 295 | 296 | // Text To Display On Panel 297 | [Category("Appearance")] 298 | public string PanelText 299 | { 300 | get { return _PanelText; } 301 | set { _PanelText = value; } 302 | } 303 | 304 | protected override void OnPaint(PaintEventArgs e) 305 | { 306 | base.OnPaint(e); 307 | Graphics g = e.Graphics; 308 | g.SmoothingMode = SmoothingMode.HighQuality; 309 | g.InterpolationMode = InterpolationMode.HighQualityBicubic; 310 | g.TextRenderingHint = TextRenderingHint.ClearTypeGridFit; 311 | int x = ClientSize.Width; 312 | int y = ClientSize.Height; 313 | 314 | // Top Bar Fill 315 | g.FillRectangle(new SolidBrush(Color.FromArgb(25, 0, 0, 0)), new Rectangle(0, 0, x, 25)); 316 | 317 | if (PanelText == null) 318 | { 319 | _PanelText = Name; 320 | } 321 | 322 | // Main Fill & Draw Text 323 | g.FillRectangle(new SolidBrush(Color.FromArgb(50, 0, 0, 0)), new Rectangle(0, 0, x, y)); 324 | g.DrawString(_PanelText, Font, new SolidBrush(Color.White), new Point(5, 5)); 325 | 326 | g.Dispose(); 327 | } 328 | } 329 | 330 | class EC_Tabs : TabControl 331 | { 332 | // Initialize 333 | public EC_Tabs() 334 | { 335 | DrawMode = TabDrawMode.OwnerDrawFixed; 336 | SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.DoubleBuffer | ControlStyles.ResizeRedraw | ControlStyles.UserPaint, true); 337 | DoubleBuffered = true; 338 | Dock = DockStyle.Bottom; 339 | SizeMode = TabSizeMode.Normal; 340 | ItemSize = new Size(100, 20); 341 | } 342 | 343 | // Tabs Back Color Property 344 | private Color m_Backcolor = Color.Empty; 345 | [Browsable(true)] 346 | public override Color BackColor 347 | { 348 | get 349 | { 350 | if (m_Backcolor.Equals(Color.Empty)) 351 | { 352 | if (Parent == null) 353 | return Control.DefaultBackColor; 354 | else 355 | return Parent.BackColor; 356 | } 357 | return m_Backcolor; 358 | } 359 | set 360 | { 361 | if (m_Backcolor.Equals(value)) return; 362 | m_Backcolor = value; 363 | Invalidate(); 364 | base.OnBackColorChanged(EventArgs.Empty); 365 | } 366 | } 367 | 368 | public bool ShouldSerializeBackColor() 369 | { 370 | return !m_Backcolor.Equals(Color.Empty); 371 | } 372 | 373 | public override void ResetBackColor() 374 | { 375 | m_Backcolor = Color.Empty; 376 | Invalidate(); 377 | } 378 | 379 | protected override void OnPaint(PaintEventArgs e) 380 | { 381 | base.OnPaint(e); 382 | Graphics g = e.Graphics; 383 | g.Clear(BackColor); 384 | 385 | g.SmoothingMode = SmoothingMode.HighQuality; 386 | g.InterpolationMode = InterpolationMode.HighQualityBicubic; 387 | 388 | // Apply Colouring To Each Tab Page 389 | for (int i = 0; i <= TabPages.Count - 1; i++) 390 | { 391 | Rectangle rect = GetTabRect(i); 392 | Rectangle r = new Rectangle(GetTabRect(i).X + 10, GetTabRect(i).Y + 3, 100, 20); 393 | if (SelectedTab == TabPages[i]) 394 | { 395 | g.FillRectangle(new SolidBrush(Color.FromArgb(75, 0, 0, 0)), rect); 396 | } 397 | else 398 | { 399 | g.FillRectangle(new SolidBrush(Color.FromArgb(25, 0, 0, 0)), rect); 400 | } 401 | 402 | // Draw Tab Page Text 403 | g.DrawString(TabPages[i].Text, Font, new SolidBrush(Color.White), (Rectangle)r); 404 | TabPages[i].UseVisualStyleBackColor = false; 405 | } 406 | } 407 | } 408 | 409 | class EC_Notification : UserControl 410 | { 411 | string _Text; 412 | 413 | // Initialize 414 | public EC_Notification() 415 | { 416 | SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint, true); 417 | DoubleBuffered = true; 418 | BackColor = Color.Transparent; 419 | Size = new Size(200, 25); 420 | } 421 | 422 | // Notification Property 423 | [Category("Appearance")] 424 | public string Notification 425 | { 426 | get { return _Text; } 427 | set { _Text = value; } 428 | } 429 | 430 | protected override void OnPaint(PaintEventArgs e) 431 | { 432 | base.OnPaint(e); 433 | Graphics g = e.Graphics; 434 | 435 | SizeF s = g.MeasureString(_Text, Font); 436 | g.SmoothingMode = SmoothingMode.HighQuality; 437 | g.InterpolationMode = InterpolationMode.HighQualityBicubic; 438 | int x = ClientSize.Width; 439 | int y = ClientSize.Height; 440 | 441 | // Notification Shadow 442 | g.FillRectangle(new SolidBrush(Color.FromArgb(35, Color.Black)), new Rectangle(5, 5, x, y)); 443 | // Notification Fill 444 | g.FillRectangle(new SolidBrush(Color.White), new Rectangle(0, 0, x - 5, y - 5)); 445 | // Notification Text 446 | g.DrawString(_Text, Font, new SolidBrush(Color.Black), new PointF(5, ((y - 5) - s.Height) / 2)); 447 | } 448 | } 449 | 450 | class EC_ProgressBar : Control 451 | { 452 | int max = 100; 453 | int min = 0; 454 | int val = 0; 455 | 456 | // Initialize 457 | public EC_ProgressBar() 458 | { 459 | base.Size = new Size(150, 15); 460 | SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.ResizeRedraw | ControlStyles.DoubleBuffer | ControlStyles.SupportsTransparentBackColor, true); 461 | BackColor = Color.FromArgb(25, 0, 0, 0); 462 | ForeColor = Color.FromArgb(200, 255, 255, 255); 463 | } 464 | 465 | // Progress Bar Minimum Value 466 | public int Min 467 | { 468 | get { return min; } 469 | set 470 | { 471 | if (value < 0) 472 | { 473 | min = 0; 474 | } 475 | if (value > max) 476 | { 477 | min = value; 478 | min = value; 479 | } 480 | if (value < min) 481 | { 482 | value = min; 483 | } 484 | Invalidate(); 485 | } 486 | } 487 | 488 | // Progress Bar Maximum Value 489 | public int Max 490 | { 491 | get { return max; } 492 | set 493 | { 494 | if (value < min) 495 | { 496 | min = value; 497 | } 498 | max = value; 499 | if (value > max) 500 | { 501 | value = max; 502 | } 503 | Invalidate(); 504 | } 505 | } 506 | 507 | // Progress Bar Current Value 508 | public int Value 509 | { 510 | get { return val; } 511 | set 512 | { 513 | int oldValue = val; 514 | if (value < min) 515 | { 516 | val = min; 517 | } 518 | else if (value > max) 519 | { 520 | val = max; 521 | } 522 | else 523 | { 524 | val = value; 525 | } 526 | 527 | float percent; 528 | 529 | Rectangle newValueRect = new Rectangle(ClientRectangle.X + 2, ClientRectangle.Y + 2, 530 | ClientRectangle.Width - 4, ClientRectangle.Height - 4); 531 | Rectangle oldValueRect = new Rectangle(ClientRectangle.X + 2, ClientRectangle.Y + 2, 532 | ClientRectangle.Width - 4, ClientRectangle.Height - 4); 533 | 534 | percent = (float)(val - min) / (float)(max - min); 535 | newValueRect.Width = (int)((float)newValueRect.Width * percent); 536 | 537 | percent = (float)(oldValue - min) / (float)(max - min); 538 | oldValueRect.Width = (int)((float)oldValueRect.Width * percent); 539 | 540 | Rectangle updateRect = new Rectangle(); 541 | 542 | if (newValueRect.Width > oldValueRect.Width) 543 | { 544 | updateRect.X = oldValueRect.Size.Width; 545 | updateRect.Width = newValueRect.Width - oldValueRect.Width; 546 | } 547 | else 548 | { 549 | updateRect.X = newValueRect.Size.Width; 550 | updateRect.Width = oldValueRect.Width - newValueRect.Width; 551 | } 552 | 553 | updateRect.Height = Height; 554 | Invalidate(updateRect); 555 | } 556 | } 557 | 558 | protected override void OnPaintBackground(PaintEventArgs pevent) 559 | { 560 | base.OnPaintBackground(pevent); 561 | Graphics g = pevent.Graphics; 562 | // Progress Bar Background Colour 563 | g.FillRectangle(new SolidBrush(BackColor), new Rectangle(0, 0, Width, Height)); 564 | } 565 | 566 | protected override void OnPaint(PaintEventArgs e) 567 | { 568 | base.OnPaint(e); 569 | Graphics g = e.Graphics; 570 | SolidBrush brush = new SolidBrush(ForeColor); 571 | float percent = (float)(val - min) / (float)(max - min); 572 | Rectangle rect = new Rectangle(2, 2, Width - 4, Height - 4); 573 | rect.Width = (int)((float)rect.Width * percent); 574 | 575 | // Progress Bar ForeColour 576 | g.FillRectangle(brush, rect); 577 | } 578 | } 579 | 580 | class EC_TextBox : RichTextBox 581 | { 582 | // Initialize 583 | public EC_TextBox() 584 | { 585 | BorderStyle = BorderStyle.None; 586 | Multiline = false; 587 | Size = new Size(Size.Width, 20); 588 | MaximumSize = new Size(int.MaxValue, Size.Height); 589 | MinimumSize = Size; 590 | } 591 | 592 | // PREVENT FLICKERING 593 | protected override void OnPaintBackground(PaintEventArgs pevent) 594 | { 595 | base.OnPaintBackground(pevent); 596 | } 597 | 598 | private const int WM_PAINT = 15; 599 | protected override void WndProc(ref Message m) 600 | { 601 | if (m.Msg == WM_PAINT) 602 | { 603 | Invalidate(); 604 | base.WndProc(ref m); 605 | using (Graphics g = Graphics.FromHwnd(Handle)) 606 | { 607 | g.InterpolationMode = InterpolationMode.HighQualityBicubic; 608 | } 609 | } 610 | else 611 | { 612 | base.WndProc(ref m); 613 | } 614 | } 615 | } 616 | } -------------------------------------------------------------------------------- /Windows Forms Themes/c#_purityx_theme.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualBasic; 2 | using System; 3 | using System.Collections; 4 | using System.Collections.Generic; 5 | using System.Data; 6 | using System.Diagnostics; 7 | using System.Windows.Forms; 8 | using System.Drawing; 9 | //Creator: Slurms Makenzi 10 | //Thanks Aeon for theme class! 11 | //Date: 7/7/2011 12 | //Site: www.loungeforum.net 13 | //Version: 1.0 14 | //Thanks xZ3ROxPROJ3CTx/Janniek kuenen 15 | //http://www.hackforums.net/showthread.php?tid=1472377 16 | // 17 | 18 | //\\\\\\\\\\\\\\\Use Credits Were Credits Are Needed/////////////////// 19 | 20 | // 21 | 22 | #region "Imports" 23 | using System.Drawing.Drawing2D; 24 | using System.ComponentModel; 25 | using System.Runtime.InteropServices; 26 | #endregion 27 | abstract class Theme : ContainerControl 28 | { 29 | 30 | #region " Initialization " 31 | 32 | protected Graphics G; 33 | public Theme() 34 | { 35 | SetStyle((ControlStyles)139270, true); 36 | } 37 | 38 | private bool ParentIsForm; 39 | protected override void OnHandleCreated(EventArgs e) 40 | { 41 | Dock = DockStyle.Fill; 42 | ParentIsForm = Parent is Form; 43 | if (ParentIsForm) 44 | { 45 | if (!(_TransparencyKey == Color.Empty)) 46 | ParentForm.TransparencyKey = _TransparencyKey; 47 | ParentForm.FormBorderStyle = FormBorderStyle.None; 48 | } 49 | base.OnHandleCreated(e); 50 | } 51 | 52 | public override string Text 53 | { 54 | get { return base.Text; } 55 | set 56 | { 57 | base.Text = value; 58 | Invalidate(); 59 | } 60 | } 61 | #endregion 62 | 63 | #region " Sizing and Movement " 64 | 65 | private bool _Resizable = true; 66 | public bool Resizable 67 | { 68 | get { return _Resizable; } 69 | set { _Resizable = value; } 70 | } 71 | 72 | private int _MoveHeight = 24; 73 | public int MoveHeight 74 | { 75 | get { return _MoveHeight; } 76 | set 77 | { 78 | _MoveHeight = value; 79 | Header = new Rectangle(7, 7, Width - 14, _MoveHeight - 7); 80 | } 81 | } 82 | 83 | private IntPtr Flag; 84 | protected override void OnMouseDown(MouseEventArgs e) 85 | { 86 | if (!(e.Button == MouseButtons.Left)) 87 | return; 88 | if (ParentIsForm) 89 | if (ParentForm.WindowState == FormWindowState.Maximized) 90 | return; 91 | 92 | if (Header.Contains(e.Location)) 93 | { 94 | Flag = new IntPtr(2); 95 | } 96 | else if (Current.Position == 0 | !_Resizable) 97 | { 98 | return; 99 | } 100 | else 101 | { 102 | Flag = new IntPtr(Current.Position); 103 | } 104 | 105 | Capture = false; 106 | Message msg = Message.Create(Parent.Handle, 161, Flag, System.IntPtr.Zero); 107 | DefWndProc(ref msg); 108 | 109 | base.OnMouseDown(e); 110 | } 111 | 112 | private struct Pointer 113 | { 114 | public readonly Cursor Cursor; 115 | public readonly byte Position; 116 | public Pointer(Cursor c, byte p) 117 | { 118 | Cursor = c; 119 | Position = p; 120 | } 121 | } 122 | 123 | private bool F1; 124 | private bool F2; 125 | private bool F3; 126 | private bool F4; 127 | private Point PTC; 128 | private Pointer GetPointer() 129 | { 130 | PTC = PointToClient(MousePosition); 131 | F1 = PTC.X < 7; 132 | F2 = PTC.X > Width - 7; 133 | F3 = PTC.Y < 7; 134 | F4 = PTC.Y > Height - 7; 135 | 136 | if (F1 & F3) 137 | return new Pointer(Cursors.SizeNWSE, 13); 138 | if (F1 & F4) 139 | return new Pointer(Cursors.SizeNESW, 16); 140 | if (F2 & F3) 141 | return new Pointer(Cursors.SizeNESW, 14); 142 | if (F2 & F4) 143 | return new Pointer(Cursors.SizeNWSE, 17); 144 | if (F1) 145 | return new Pointer(Cursors.SizeWE, 10); 146 | if (F2) 147 | return new Pointer(Cursors.SizeWE, 11); 148 | if (F3) 149 | return new Pointer(Cursors.SizeNS, 12); 150 | if (F4) 151 | return new Pointer(Cursors.SizeNS, 15); 152 | return new Pointer(Cursors.Default, 0); 153 | } 154 | 155 | private Pointer Current; 156 | private Pointer Pending; 157 | private void SetCurrent() 158 | { 159 | Pending = GetPointer(); 160 | if (Current.Position == Pending.Position) 161 | return; 162 | Current = GetPointer(); 163 | Cursor = Current.Cursor; 164 | } 165 | 166 | protected override void OnMouseMove(MouseEventArgs e) 167 | { 168 | if (_Resizable) 169 | SetCurrent(); 170 | base.OnMouseMove(e); 171 | } 172 | 173 | protected Rectangle Header; 174 | protected override void OnSizeChanged(EventArgs e) 175 | { 176 | if (Width == 0 || Height == 0) 177 | return; 178 | Header = new Rectangle(7, 7, Width - 14, _MoveHeight - 7); 179 | Invalidate(); 180 | base.OnSizeChanged(e); 181 | } 182 | 183 | #endregion 184 | 185 | #region " Convienence " 186 | 187 | public abstract void PaintHook(); 188 | protected override sealed void OnPaint(PaintEventArgs e) 189 | { 190 | if (Width == 0 || Height == 0) 191 | return; 192 | G = e.Graphics; 193 | PaintHook(); 194 | } 195 | 196 | private Color _TransparencyKey; 197 | public Color TransparencyKey 198 | { 199 | get { return _TransparencyKey; } 200 | set 201 | { 202 | _TransparencyKey = value; 203 | Invalidate(); 204 | } 205 | } 206 | 207 | private Image _Image; 208 | public Image Image 209 | { 210 | get { return _Image; } 211 | set 212 | { 213 | _Image = value; 214 | Invalidate(); 215 | } 216 | } 217 | public int ImageWidth 218 | { 219 | get 220 | { 221 | if (_Image == null) 222 | return 0; 223 | return _Image.Width; 224 | } 225 | } 226 | 227 | private Size _Size; 228 | private Rectangle _Rectangle; 229 | private LinearGradientBrush _Gradient; 230 | 231 | private SolidBrush _Brush; 232 | protected void DrawCorners(Color c, Rectangle rect) 233 | { 234 | _Brush = new SolidBrush(c); 235 | G.FillRectangle(_Brush, rect.X, rect.Y, 1, 1); 236 | G.FillRectangle(_Brush, rect.X + (rect.Width - 1), rect.Y, 1, 1); 237 | G.FillRectangle(_Brush, rect.X, rect.Y + (rect.Height - 1), 1, 1); 238 | G.FillRectangle(_Brush, rect.X + (rect.Width - 1), rect.Y + (rect.Height - 1), 1, 1); 239 | } 240 | 241 | protected void DrawBorders(Pen p1, Pen p2, Rectangle rect) 242 | { 243 | G.DrawRectangle(p1, rect.X, rect.Y, rect.Width - 1, rect.Height - 1); 244 | G.DrawRectangle(p2, rect.X + 1, rect.Y + 1, rect.Width - 3, rect.Height - 3); 245 | } 246 | 247 | protected void DrawText(HorizontalAlignment a, Color c, int x) 248 | { 249 | DrawText(a, c, x, 0); 250 | } 251 | protected void DrawText(HorizontalAlignment a, Color c, int x, int y) 252 | { 253 | if (string.IsNullOrEmpty(Text)) 254 | return; 255 | _Size = G.MeasureString(Text, Font).ToSize(); 256 | _Brush = new SolidBrush(c); 257 | 258 | switch (a) 259 | { 260 | case HorizontalAlignment.Left: 261 | G.DrawString(Text, Font, _Brush, x, _MoveHeight / 2 - _Size.Height / 2 + y); 262 | break; 263 | case HorizontalAlignment.Right: 264 | G.DrawString(Text, Font, _Brush, Width - _Size.Width - x, _MoveHeight / 2 - _Size.Height / 2 + y); 265 | break; 266 | case HorizontalAlignment.Center: 267 | G.DrawString(Text, Font, _Brush, Width / 2 - _Size.Width / 2 + x, _MoveHeight / 2 - _Size.Height / 2 + y); 268 | break; 269 | } 270 | } 271 | 272 | protected void DrawIcon(HorizontalAlignment a, int x) 273 | { 274 | DrawIcon(a, x, 0); 275 | } 276 | protected void DrawIcon(HorizontalAlignment a, int x, int y) 277 | { 278 | if (_Image == null) 279 | return; 280 | switch (a) 281 | { 282 | case HorizontalAlignment.Left: 283 | G.DrawImage(_Image, x, _MoveHeight / 2 - _Image.Height / 2 + y); 284 | break; 285 | case HorizontalAlignment.Right: 286 | G.DrawImage(_Image, Width - _Image.Width - x, _MoveHeight / 2 - _Image.Height / 2 + y); 287 | break; 288 | case HorizontalAlignment.Center: 289 | G.DrawImage(_Image, Width / 2 - _Image.Width / 2, _MoveHeight / 2 - _Image.Height / 2); 290 | break; 291 | } 292 | } 293 | 294 | protected void DrawGradient(Color c1, Color c2, int x, int y, int width, int height, float angle) 295 | { 296 | _Rectangle = new Rectangle(x, y, width, height); 297 | _Gradient = new LinearGradientBrush(_Rectangle, c1, c2, angle); 298 | G.FillRectangle(_Gradient, _Rectangle); 299 | } 300 | 301 | #endregion 302 | 303 | } 304 | abstract class ThemeControl : Control 305 | { 306 | 307 | #region " Initialization " 308 | 309 | protected Graphics G; 310 | protected Bitmap B; 311 | public ThemeControl() 312 | { 313 | SetStyle((ControlStyles)139270, true); 314 | B = new Bitmap(1, 1); 315 | G = Graphics.FromImage(B); 316 | } 317 | 318 | public void AllowTransparent() 319 | { 320 | SetStyle(ControlStyles.Opaque, false); 321 | SetStyle(ControlStyles.SupportsTransparentBackColor, true); 322 | } 323 | 324 | public override string Text 325 | { 326 | get { return base.Text; } 327 | set 328 | { 329 | base.Text = value; 330 | Invalidate(); 331 | } 332 | } 333 | #endregion 334 | 335 | #region " Mouse Handling " 336 | 337 | protected enum State : byte 338 | { 339 | MouseNone = 0, 340 | MouseOver = 1, 341 | MouseDown = 2 342 | } 343 | 344 | protected State MouseState; 345 | protected override void OnMouseLeave(EventArgs e) 346 | { 347 | ChangeMouseState(State.MouseNone); 348 | base.OnMouseLeave(e); 349 | } 350 | protected override void OnMouseEnter(EventArgs e) 351 | { 352 | ChangeMouseState(State.MouseOver); 353 | base.OnMouseEnter(e); 354 | } 355 | protected override void OnMouseUp(MouseEventArgs e) 356 | { 357 | ChangeMouseState(State.MouseOver); 358 | base.OnMouseUp(e); 359 | } 360 | protected override void OnMouseDown(MouseEventArgs e) 361 | { 362 | if (e.Button == MouseButtons.Left) 363 | ChangeMouseState(State.MouseDown); 364 | base.OnMouseDown(e); 365 | } 366 | 367 | private void ChangeMouseState(State e) 368 | { 369 | MouseState = e; 370 | Invalidate(); 371 | } 372 | 373 | #endregion 374 | 375 | #region " Convienence " 376 | 377 | public abstract void PaintHook(); 378 | protected override sealed void OnPaint(PaintEventArgs e) 379 | { 380 | if (Width == 0 || Height == 0) 381 | return; 382 | PaintHook(); 383 | e.Graphics.DrawImage(B, 0, 0); 384 | } 385 | 386 | protected override void OnSizeChanged(EventArgs e) 387 | { 388 | if (!(Width == 0) && !(Height == 0)) 389 | { 390 | B = new Bitmap(Width, Height); 391 | G = Graphics.FromImage(B); 392 | Invalidate(); 393 | } 394 | base.OnSizeChanged(e); 395 | } 396 | 397 | private bool _NoRounding; 398 | public bool NoRounding 399 | { 400 | get { return _NoRounding; } 401 | set 402 | { 403 | _NoRounding = value; 404 | Invalidate(); 405 | } 406 | } 407 | 408 | private Image _Image; 409 | public Image Image 410 | { 411 | get { return _Image; } 412 | set 413 | { 414 | _Image = value; 415 | Invalidate(); 416 | } 417 | } 418 | public int ImageWidth 419 | { 420 | get 421 | { 422 | if (_Image == null) 423 | return 0; 424 | return _Image.Width; 425 | } 426 | } 427 | public int ImageTop 428 | { 429 | get 430 | { 431 | if (_Image == null) 432 | return 0; 433 | return Height / 2 - _Image.Height / 2; 434 | } 435 | } 436 | 437 | private Size _Size; 438 | private Rectangle _Rectangle; 439 | private LinearGradientBrush _Gradient; 440 | 441 | private SolidBrush _Brush; 442 | protected void DrawCorners(Color c, Rectangle rect) 443 | { 444 | if (_NoRounding) 445 | return; 446 | 447 | B.SetPixel(rect.X, rect.Y, c); 448 | B.SetPixel(rect.X + (rect.Width - 1), rect.Y, c); 449 | B.SetPixel(rect.X, rect.Y + (rect.Height - 1), c); 450 | B.SetPixel(rect.X + (rect.Width - 1), rect.Y + (rect.Height - 1), c); 451 | } 452 | 453 | protected void DrawBorders(Pen p1, Pen p2, Rectangle rect) 454 | { 455 | G.DrawRectangle(p1, rect.X, rect.Y, rect.Width - 1, rect.Height - 1); 456 | G.DrawRectangle(p2, rect.X + 1, rect.Y + 1, rect.Width - 3, rect.Height - 3); 457 | } 458 | 459 | protected void DrawText(HorizontalAlignment a, Color c, int x) 460 | { 461 | DrawText(a, c, x, 0); 462 | } 463 | protected void DrawText(HorizontalAlignment a, Color c, int x, int y) 464 | { 465 | if (string.IsNullOrEmpty(Text)) 466 | return; 467 | _Size = G.MeasureString(Text, Font).ToSize(); 468 | _Brush = new SolidBrush(c); 469 | 470 | switch (a) 471 | { 472 | case HorizontalAlignment.Left: 473 | G.DrawString(Text, Font, _Brush, x, Height / 2 - _Size.Height / 2 + y); 474 | break; 475 | case HorizontalAlignment.Right: 476 | G.DrawString(Text, Font, _Brush, Width - _Size.Width - x, Height / 2 - _Size.Height / 2 + y); 477 | break; 478 | case HorizontalAlignment.Center: 479 | G.DrawString(Text, Font, _Brush, Width / 2 - _Size.Width / 2 + x, Height / 2 - _Size.Height / 2 + y); 480 | break; 481 | } 482 | } 483 | 484 | protected void DrawIcon(HorizontalAlignment a, int x) 485 | { 486 | DrawIcon(a, x, 0); 487 | } 488 | protected void DrawIcon(HorizontalAlignment a, int x, int y) 489 | { 490 | if (_Image == null) 491 | return; 492 | switch (a) 493 | { 494 | case HorizontalAlignment.Left: 495 | G.DrawImage(_Image, x, Height / 2 - _Image.Height / 2 + y); 496 | break; 497 | case HorizontalAlignment.Right: 498 | G.DrawImage(_Image, Width - _Image.Width - x, Height / 2 - _Image.Height / 2 + y); 499 | break; 500 | case HorizontalAlignment.Center: 501 | G.DrawImage(_Image, Width / 2 - _Image.Width / 2, Height / 2 - _Image.Height / 2); 502 | break; 503 | } 504 | } 505 | 506 | protected void DrawGradient(Color c1, Color c2, int x, int y, int width, int height, float angle) 507 | { 508 | _Rectangle = new Rectangle(x, y, width, height); 509 | _Gradient = new LinearGradientBrush(_Rectangle, c1, c2, angle); 510 | G.FillRectangle(_Gradient, _Rectangle); 511 | } 512 | #endregion 513 | 514 | } 515 | abstract class ThemeContainerControl : ContainerControl 516 | { 517 | 518 | #region " Initialization " 519 | 520 | protected Graphics G; 521 | protected Bitmap B; 522 | public ThemeContainerControl() 523 | { 524 | SetStyle((ControlStyles)139270, true); 525 | B = new Bitmap(1, 1); 526 | G = Graphics.FromImage(B); 527 | } 528 | 529 | public void AllowTransparent() 530 | { 531 | SetStyle(ControlStyles.Opaque, false); 532 | SetStyle(ControlStyles.SupportsTransparentBackColor, true); 533 | } 534 | 535 | #endregion 536 | 537 | #region " Convienence " 538 | 539 | public abstract void PaintHook(); 540 | protected override sealed void OnPaint(PaintEventArgs e) 541 | { 542 | if (Width == 0 || Height == 0) 543 | return; 544 | PaintHook(); 545 | e.Graphics.DrawImage(B, 0, 0); 546 | } 547 | 548 | protected override void OnSizeChanged(EventArgs e) 549 | { 550 | if (!(Width == 0) && !(Height == 0)) 551 | { 552 | B = new Bitmap(Width, Height); 553 | G = Graphics.FromImage(B); 554 | Invalidate(); 555 | } 556 | base.OnSizeChanged(e); 557 | } 558 | 559 | private bool _NoRounding; 560 | public bool NoRounding 561 | { 562 | get { return _NoRounding; } 563 | set 564 | { 565 | _NoRounding = value; 566 | Invalidate(); 567 | } 568 | } 569 | 570 | private Rectangle _Rectangle; 571 | 572 | private LinearGradientBrush _Gradient; 573 | protected void DrawCorners(Color c, Rectangle rect) 574 | { 575 | if (_NoRounding) 576 | return; 577 | B.SetPixel(rect.X, rect.Y, c); 578 | B.SetPixel(rect.X + (rect.Width - 1), rect.Y, c); 579 | B.SetPixel(rect.X, rect.Y + (rect.Height - 1), c); 580 | B.SetPixel(rect.X + (rect.Width - 1), rect.Y + (rect.Height - 1), c); 581 | } 582 | 583 | protected void DrawBorders(Pen p1, Pen p2, Rectangle rect) 584 | { 585 | G.DrawRectangle(p1, rect.X, rect.Y, rect.Width - 1, rect.Height - 1); 586 | G.DrawRectangle(p2, rect.X + 1, rect.Y + 1, rect.Width - 3, rect.Height - 3); 587 | } 588 | 589 | protected void DrawGradient(Color c1, Color c2, int x, int y, int width, int height, float angle) 590 | { 591 | _Rectangle = new Rectangle(x, y, width, height); 592 | _Gradient = new LinearGradientBrush(_Rectangle, c1, c2, angle); 593 | G.FillRectangle(_Gradient, _Rectangle); 594 | } 595 | #endregion 596 | 597 | } 598 | public class Draw 599 | { 600 | public static void Gradient(Graphics g, Color c1, Color c2, int x, int y, int width, int height) 601 | { 602 | Rectangle R = new Rectangle(x, y, width, height); 603 | using (LinearGradientBrush T = new LinearGradientBrush(R, c1, c2, LinearGradientMode.Vertical)) 604 | { 605 | g.FillRectangle(T, R); 606 | } 607 | } 608 | public static void Gradient(Graphics g, Color c1, Color c2, Rectangle r) 609 | { 610 | using (LinearGradientBrush T = new LinearGradientBrush(r, c1, c2, LinearGradientMode.Vertical)) 611 | { 612 | g.FillRectangle(T, r); 613 | } 614 | } 615 | public static void Blend(Graphics g, Color c1, Color c2, Color c3, float c, int d, int x, int y, int width, int height) 616 | { 617 | ColorBlend v = new ColorBlend(3); 618 | v.Colors = new Color[] { 619 | c1, 620 | c2, 621 | c3 622 | }; 623 | v.Positions = new float[] { 624 | 0, 625 | c, 626 | 1 627 | }; 628 | Rectangle R = new Rectangle(x, y, width, height); 629 | using (LinearGradientBrush T = new LinearGradientBrush(R, c1, c1, (LinearGradientMode)d)) 630 | { 631 | T.InterpolationColors = v; 632 | g.FillRectangle(T, R); 633 | } 634 | } 635 | public static GraphicsPath RoundedRectangle(int x, int y, int width, int height, int cornerwidth, int PenWidth) 636 | { 637 | GraphicsPath p = new GraphicsPath(); 638 | p.StartFigure(); 639 | p.AddArc(new Rectangle(x, y, cornerwidth, cornerwidth), 180, 90); 640 | p.AddLine(cornerwidth, y, width - cornerwidth - PenWidth, y); 641 | 642 | p.AddArc(new Rectangle(width - cornerwidth - PenWidth, y, cornerwidth, cornerwidth), -90, 90); 643 | p.AddLine(width - PenWidth, cornerwidth, width - PenWidth, height - cornerwidth - PenWidth); 644 | 645 | p.AddArc(new Rectangle(width - cornerwidth - PenWidth, height - cornerwidth - PenWidth, cornerwidth, cornerwidth), 0, 90); 646 | p.AddLine(width - cornerwidth - PenWidth, height - PenWidth, cornerwidth, height - PenWidth); 647 | 648 | p.AddArc(new Rectangle(x, height - cornerwidth - PenWidth, cornerwidth, cornerwidth), 90, 90); 649 | p.CloseFigure(); 650 | 651 | return p; 652 | } 653 | 654 | 655 | public static void BackGround(int width, int height, Graphics G) 656 | { 657 | Color P1 = Color.FromArgb(29, 25, 22); 658 | Color P2 = Color.FromArgb(35, 31, 28); 659 | 660 | for (int y = 0; y <= height; y += 4) 661 | { 662 | for (int x = 0; x <= width; x += 4) 663 | { 664 | G.FillRectangle(new SolidBrush(P1), new Rectangle(x, y, 1, 1)); 665 | G.FillRectangle(new SolidBrush(P2), new Rectangle(x, y + 1, 1, 1)); 666 | try 667 | { 668 | G.FillRectangle(new SolidBrush(P1), new Rectangle(x + 2, y + 2, 1, 1)); 669 | G.FillRectangle(new SolidBrush(P2), new Rectangle(x + 2, y + 3, 1, 1)); 670 | } 671 | catch 672 | { 673 | } 674 | } 675 | } 676 | } 677 | } 678 | class PurityxTheme : Theme 679 | { 680 | 681 | public PurityxTheme() 682 | { 683 | Resizable = false; 684 | BackColor = Color.FromKnownColor(KnownColor.Control); 685 | MoveHeight = 25; 686 | TransparencyKey = Color.Fuchsia; 687 | } 688 | 689 | public override void PaintHook() 690 | { 691 | G.Clear(BackColor); 692 | // Clear the form first 693 | 694 | //DrawGradient(Color.FromArgb(64, 64, 64), Color.FromArgb(32, 32, 32), 0, 0, Width, Height, 90S) ' Form Gradient 695 | G.Clear(Color.FromArgb(60, 60, 60)); 696 | DrawGradient(Color.FromArgb(45, 40, 45), Color.FromArgb(32, 32, 32), 0, 0, Width, 25, 90); 697 | // Form Top Bar 698 | 699 | G.DrawLine(Pens.Black, 0, 25, Width, 25); 700 | // Top Line 701 | //G.DrawLine(Pens.Black, 0, Height - 25, Width, Height - 25) ' Bottom Line 702 | 703 | DrawCorners(Color.Fuchsia, ClientRectangle); 704 | // Then draw some clean corners 705 | DrawBorders(Pens.Black, Pens.DimGray, ClientRectangle); 706 | // Then we draw our form borders 707 | 708 | DrawText(HorizontalAlignment.Left, Color.Red, 7, 1); 709 | // Finally, we draw our text 710 | } 711 | } 712 | // Theme Code 713 | class PurityxButton : ThemeControl 714 | { 715 | 716 | public override void PaintHook() 717 | { 718 | switch (MouseState) 719 | { 720 | case State.MouseNone: 721 | G.Clear(Color.Red); 722 | DrawGradient(Color.FromArgb(62, 62, 62), Color.FromArgb(38, 38, 38), 0, 0, Width, Height, 90); 723 | break; 724 | case State.MouseOver: 725 | G.Clear(Color.Red); 726 | DrawGradient(Color.FromArgb(62, 62, 62), Color.FromArgb(38, 38, 38), 0, 0, Width, Height, 90); 727 | break; 728 | case State.MouseDown: 729 | G.Clear(Color.DarkRed); 730 | DrawGradient(Color.FromArgb(38, 38, 38), Color.FromArgb(62, 62, 62), 0, 0, Width, Height, 90); 731 | break; 732 | } 733 | 734 | DrawBorders(Pens.Black, Pens.DimGray, ClientRectangle); 735 | // Form Border 736 | DrawCorners(Color.Black, ClientRectangle); 737 | // Clean Corners 738 | DrawText(HorizontalAlignment.Center, Color.Red, 0); 739 | } 740 | } 741 | // Button Code 742 | public class PurityxLabel : Label 743 | { 744 | public PurityxLabel() 745 | { 746 | Font = new Font("Arial", 8); 747 | ForeColor = Color.Red; 748 | BackColor = Color.Transparent; 749 | } 750 | } 751 | // Label Code 752 | public class PurityxSeperator : Control 753 | { 754 | 755 | protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) 756 | { 757 | using (Bitmap b = new Bitmap(Width, Height)) 758 | { 759 | using (Graphics g = Graphics.FromImage(b)) 760 | { 761 | g.Clear(BackColor); 762 | 763 | Color P1 = Color.FromArgb(255, 255, 255); 764 | Color P2 = Color.FromArgb(255, 255, 255); 765 | g.FillRectangle(new SolidBrush(Color.FromArgb(60, 60, 60)), new Rectangle(0, 0, Width, Height)); 766 | 767 | 768 | Rectangle GRec = new Rectangle(0, Height / 2, Width / 5, 2); 769 | using (LinearGradientBrush GBrush = new LinearGradientBrush(GRec, Color.Transparent, P2, LinearGradientMode.Horizontal)) 770 | { 771 | g.FillRectangle(GBrush, GRec); 772 | } 773 | g.DrawLine(new Pen(P2, 2), new Point(GRec.Width, GRec.Y + 1), new Point(Width - GRec.Width + 1, GRec.Y + 1)); 774 | 775 | GRec = new Rectangle(Width - (Width / 5), Height / 2, Width / 5, 2); 776 | using (LinearGradientBrush GBrush = new LinearGradientBrush(GRec, P2, Color.Transparent, LinearGradientMode.Horizontal)) 777 | { 778 | g.FillRectangle(GBrush, GRec); 779 | } 780 | e.Graphics.DrawImage(b, 0, 0); 781 | } 782 | } 783 | base.OnPaint(e); 784 | } 785 | } 786 | // Seperator Code 787 | class PurityxGroupbox : Panel 788 | { 789 | Color Bg = Color.FromArgb(62, 62, 62); 790 | Color PC2 = Color.FromArgb(204, 204, 204); 791 | Color FC = Color.FromArgb(204, 204, 204); 792 | Pen p; 793 | SolidBrush sb; 794 | public PurityxGroupbox() 795 | { 796 | BackColor = Bg; 797 | } 798 | string _t = ""; 799 | public string Header 800 | { 801 | get { return _t; } 802 | set 803 | { 804 | _t = value; 805 | Invalidate(); 806 | } 807 | } 808 | protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) 809 | { 810 | using (Bitmap b = new Bitmap(Width, Height)) 811 | { 812 | using (Graphics g = Graphics.FromImage(b)) 813 | { 814 | p = new Pen(PC2); 815 | sb = new SolidBrush(Bg); 816 | SizeF M = g.MeasureString(_t, Font); 817 | GraphicsPath Outline = Draw.RoundedRectangle(0, (int)M.Height / 2, Width - 1, Height - 1, 10, 1); 818 | g.Clear(BackColor); 819 | g.FillRectangle(sb, new Rectangle(0, (int)M.Height / 2, Width - 1, Height - 1)); 820 | g.DrawPath(p, Outline); 821 | g.FillRectangle(sb, new Rectangle(10, (int)(M.Height / 2) - 2, (int)M.Width + 10, (int)M.Height)); 822 | sb = new SolidBrush(FC); 823 | g.DrawString(base.Text, base.Font, Brushes.White, 7, 1); 824 | e.Graphics.DrawImage(b, 0, 0); 825 | } 826 | } 827 | base.OnPaint(e); 828 | } 829 | } 830 | // GroupBox Code -------------------------------------------------------------------------------- /Windows Forms Themes/aevion_theme_c#.cs: -------------------------------------------------------------------------------- 1 | 2 | // aevion theme convertered to c# 3 | using System; 4 | using System.Linq; 5 | using System.Drawing; 6 | using System.Windows.Forms; 7 | using System.Drawing.Drawing2D; 8 | 9 | namespace Aevion_r2 10 | { 11 | 12 | public static class Helper 13 | { 14 | public struct Fonts 15 | { 16 | public static Font Primary = new Font("Segoe UI", 9); 17 | public static Font PrimaryBold = new Font("Segoe UI", 9, FontStyle.Bold); 18 | } 19 | 20 | public struct Colors 21 | { 22 | public static Color Foreground = Color.White; 23 | public static Color Background = Color.FromArgb(48, 57, 65); 24 | } 25 | 26 | 27 | public enum MouseState : byte 28 | { 29 | None = 0, 30 | Hover = 1, 31 | Down = 2 32 | } 33 | 34 | public enum Direction : byte 35 | { 36 | Up = 0, 37 | Down = 1, 38 | Left = 3, 39 | Right = 4 40 | } 41 | 42 | public static void RoundRect(Graphics g, Int32 x, Int32 y, Int32 Width, Int32 Height, Int32 Curve, Color c) 43 | { 44 | if (Curve <= 0) throw new ArgumentException("Curve must be Greater than 0.", "Curve"); 45 | 46 | var p = new Pen(c); 47 | 48 | var BaseRect = new RectangleF(x, y, Width, Height); 49 | var ArcRect = new RectangleF(BaseRect.Location, new SizeF(Curve, Curve)); 50 | 51 | g.DrawArc(p, ArcRect, 180, 90); 52 | g.DrawLine(p, x + (Curve / 2), y, y + Width - (Curve / 2), y); 53 | 54 | ArcRect.X = BaseRect.Right - Curve; 55 | g.DrawArc(p, ArcRect, 270, 90); 56 | g.DrawLine(p, x + Width, y + (Curve / 2), x + Width, y + Height - (Curve / 2)); 57 | 58 | ArcRect.Y = BaseRect.Bottom - Curve; 59 | g.DrawArc(p, ArcRect, 0, 90); 60 | g.DrawLine(p, x + (Curve / 2), y + Height, x + Width - (Curve / 2), y + Height); 61 | 62 | ArcRect.X = BaseRect.Left; 63 | g.DrawArc(p, ArcRect, 90, 30); 64 | g.DrawLine(p, x, y + (Curve / 2), x, y + Height - (Curve / 2)); 65 | 66 | p.Dispose(); 67 | } 68 | 69 | public static void DrawTriangle(Graphics g, Rectangle r, Direction d, Color c) 70 | { 71 | var w = r.Width/2; 72 | var y = r.Height/2; 73 | 74 | Point p0 = Point.Empty, p1 = Point.Empty, p2 = Point.Empty; 75 | 76 | switch (d) 77 | { 78 | case Direction.Up: 79 | p0 = new Point(r.Left + w, r.Top); 80 | p1 = new Point(r.Left, r.Bottom); 81 | p2 = new Point(r.Right, r.Bottom); 82 | break; 83 | 84 | case Direction.Down: 85 | p0 = new Point(r.Left + w, r.Bottom); 86 | p1 = new Point(r.Left, r.Top); 87 | p2 = new Point(r.Right, r.Top); 88 | break; 89 | 90 | case Direction.Left: 91 | p0 = new Point(r.Left, r.Top + y); 92 | p1 = new Point(r.Right, r.Top); 93 | p2 = new Point(r.Right, r.Bottom); 94 | break; 95 | 96 | case Direction.Right: 97 | p0 = new Point(r.Right, r.Top + y); 98 | p1 = new Point(r.Left, r.Bottom); 99 | p2 = new Point(r.Left, r.Top); 100 | break; 101 | } 102 | 103 | var s = new SolidBrush(c); 104 | g.FillPolygon(s, new [] {p0, p1, p2}); 105 | 106 | MultiDispose(s); 107 | } 108 | 109 | public static void CenterString(Graphics g, String Text, Font Font, Color c, Rectangle rect, Boolean Shadow = false, Int32 yOffset = 1) 110 | { 111 | CenterString(g, Text, Font, new SolidBrush(c), rect, Shadow, yOffset); 112 | } 113 | 114 | public static void CenterString(Graphics g, String Text, Font Font, Brush b, Rectangle rect, Boolean Shadow = false, Int32 yOffset = 1) 115 | { 116 | var TextSize = g.MeasureString(Text, Font); 117 | var x = rect.X + (rect.Width / 2) - (TextSize.Width / 2); 118 | var y = rect.Y + (rect.Height / 2) - (TextSize.Height / 2) + yOffset; 119 | 120 | if (Shadow) 121 | g.DrawString(Text, Font, Brushes.Black, x + 1, y + 1); 122 | g.DrawString(Text, Font, b, x, y); 123 | 124 | b.Dispose(); 125 | } 126 | 127 | public static Single ValueToPercentage(Int32 Value, Int32 Maximum, Int32 Minimum) 128 | { 129 | return (Single)(Value - Minimum) / (Maximum - Minimum); 130 | } 131 | 132 | public static void MultiDispose(params IDisposable[] Disposables) 133 | { 134 | foreach (var Disposable in Disposables.Where(Disposable => Disposable != null)) 135 | { 136 | Disposable.Dispose(); 137 | } 138 | } 139 | } 140 | 141 | sealed class AevionForm : Control 142 | { 143 | public AevionForm() 144 | { 145 | DoubleBuffered = true; 146 | Font = Helper.Fonts.Primary; 147 | ForeColor = Helper.Colors.Foreground; 148 | BackColor = Helper.Colors.Background; 149 | Dock = DockStyle.Fill; 150 | } 151 | 152 | protected override void OnPaint(PaintEventArgs e) 153 | { 154 | base.OnPaint(e); 155 | var g = e.Graphics; 156 | g.SmoothingMode=SmoothingMode.HighQuality; 157 | g.Clear(Helper.Colors.Background); 158 | } 159 | 160 | } 161 | 162 | sealed class AevionButton : Button 163 | { 164 | private Helper.MouseState State = Helper.MouseState.None; 165 | private LinearGradientBrush l1, l2, l3 = null; 166 | 167 | public enum Style 168 | { 169 | Default, 170 | Green, 171 | Red 172 | } 173 | 174 | private Style _ButtonStyle = Style.Default; 175 | private Image _Icon; 176 | private Boolean _ShowIcon = false; 177 | 178 | public Style ButtonStyle 179 | { 180 | get { return _ButtonStyle; } 181 | set { _ButtonStyle = value; Invalidate(); } 182 | } 183 | 184 | public Image Icon 185 | { 186 | get { return _Icon; } 187 | set { _Icon = value; Invalidate(); } 188 | } 189 | 190 | public Boolean ShowIcon 191 | { 192 | get { return _ShowIcon; } 193 | set { _ShowIcon = value; Invalidate(); } 194 | } 195 | 196 | public override string Text 197 | { 198 | get { return base.Text; } 199 | set { base.Text = value; Invalidate(); } 200 | } 201 | 202 | public override Font Font 203 | { 204 | get { return base.Font; } 205 | set { base.Font = value; Invalidate(); } 206 | } 207 | 208 | public AevionButton() 209 | { 210 | DoubleBuffered = true; 211 | Font = Helper.Fonts.PrimaryBold; 212 | SetStyle(ControlStyles.UserPaint | ControlStyles.SupportsTransparentBackColor, true); 213 | } 214 | 215 | protected override void OnMouseDown(MouseEventArgs mevent) 216 | { 217 | base.OnMouseDown(mevent); 218 | State = Helper.MouseState.Down; 219 | Invalidate(); 220 | } 221 | 222 | protected override void OnMouseUp(MouseEventArgs mevent) 223 | { 224 | base.OnMouseUp(mevent); 225 | State = Helper.MouseState.None; 226 | Invalidate(); 227 | } 228 | 229 | protected override void OnMouseEnter(EventArgs e) 230 | { 231 | base.OnMouseEnter(e); 232 | State = Helper.MouseState.Hover; 233 | Invalidate(); 234 | } 235 | 236 | protected override void OnMouseLeave(EventArgs e) 237 | { 238 | base.OnMouseLeave(e); 239 | State = Helper.MouseState.None; 240 | Invalidate(); 241 | } 242 | 243 | protected override void OnPaint(PaintEventArgs e) 244 | { 245 | base.OnPaint(e); 246 | var g = e.Graphics; 247 | g.SmoothingMode = SmoothingMode.HighQuality; 248 | g.Clear(Helper.Colors.Background); 249 | 250 | switch (ButtonStyle) 251 | { 252 | case Style.Default: 253 | l1 = new LinearGradientBrush(new Rectangle(0, 0, Width, Height + 35), Color.FromArgb(88, 105, 123), Color.Black, LinearGradientMode.Vertical); 254 | l2 = new LinearGradientBrush(new Rectangle(0, 0, Width, Height + 35), Color.FromArgb(108, 125, 143), Color.Black, LinearGradientMode.Vertical); 255 | l3 = new LinearGradientBrush(new Rectangle(0, 0, Width, Height + 35), Color.FromArgb(98, 115, 133), Color.Black, LinearGradientMode.Vertical); 256 | break; 257 | case Style.Red: 258 | l1 = new LinearGradientBrush(new Rectangle(0, 0, Width, Height + 35), Color.FromArgb(173, 83, 74), Color.Black, LinearGradientMode.Vertical); 259 | l2 = new LinearGradientBrush(new Rectangle(0, 0, Width, Height + 35), Color.FromArgb(193, 103, 94), Color.Black, LinearGradientMode.Vertical); 260 | l3 = new LinearGradientBrush(new Rectangle(0, 0, Width, Height + 35), Color.FromArgb(183, 93, 84), Color.Black, LinearGradientMode.Vertical); 261 | break; 262 | case Style.Green: 263 | l1 = new LinearGradientBrush(new Rectangle(0, 0, Width, Height + 35), Color.FromArgb(127, 177, 80), Color.Black, LinearGradientMode.Vertical); 264 | l2 = new LinearGradientBrush(new Rectangle(0, 0, Width, Height + 35), Color.FromArgb(157, 197, 100), Color.Black, LinearGradientMode.Vertical); 265 | l3 = new LinearGradientBrush(new Rectangle(0, 0, Width, Height + 35), Color.FromArgb(147, 187, 90), Color.Black, LinearGradientMode.Vertical); 266 | break; 267 | } 268 | 269 | switch (State) 270 | { 271 | case Helper.MouseState.Down: 272 | g.FillRectangle(l1, new Rectangle(1, 1, Width - 2, Height - 2)); 273 | break; 274 | case Helper.MouseState.Hover: 275 | g.FillRectangle(l2, new Rectangle(1, 1, Width - 2, Height - 2)); 276 | break; 277 | case Helper.MouseState.None: 278 | g.FillRectangle(l3, new Rectangle(1, 1, Width - 2, Height - 2)); 279 | break; 280 | } 281 | 282 | Helper.RoundRect(g, 0, 0, Width - 1, Height - 1, 3, Color.FromArgb(38, 38, 38)); 283 | 284 | if (ShowIcon) 285 | g.DrawImage(Icon, new Point(Width / 8, Height / 2 - 8)); 286 | 287 | Helper.CenterString(g, Text, Font, Helper.Colors.Foreground, new Rectangle(0, 0, Width, Height)); 288 | 289 | } 290 | } 291 | 292 | sealed class AevionRadioButton : Control 293 | { 294 | public event EventHandler CheckedChanged = delegate { }; 295 | 296 | private Boolean _Checked; 297 | 298 | public Boolean Checked 299 | { 300 | get { return _Checked; } 301 | set { 302 | _Checked = value; 303 | Invalidate(); 304 | CheckedChanged(this, new EventArgs()); 305 | } 306 | } 307 | 308 | public override string Text 309 | { 310 | get { return base.Text; } 311 | set { base.Text = value; Invalidate(); } 312 | } 313 | 314 | public override Font Font 315 | { 316 | get { return base.Font; } 317 | set { base.Font = value; Invalidate(); } 318 | } 319 | 320 | public AevionRadioButton() 321 | { 322 | DoubleBuffered = true; 323 | Size = new Size(Width, 16); 324 | Font = Helper.Fonts.Primary; 325 | SetStyle(ControlStyles.UserPaint | ControlStyles.SupportsTransparentBackColor, true); 326 | } 327 | 328 | protected override void OnResize(EventArgs e) 329 | { 330 | base.OnResize(e); 331 | Size = new Size(Width, 16); 332 | } 333 | 334 | protected override void OnMouseUp(MouseEventArgs e) 335 | { 336 | base.OnMouseUp(e); 337 | Checked = !Checked; 338 | } 339 | 340 | protected override void OnPaint(PaintEventArgs e) 341 | { 342 | base.OnPaint(e); 343 | var g = e.Graphics; 344 | var p = new Pen(Color.FromArgb(35, 35, 40)); 345 | var s = new SolidBrush(Color.FromArgb(220, 220, 255)); 346 | 347 | g.SmoothingMode = SmoothingMode.HighQuality; 348 | g.Clear(Helper.Colors.Background); 349 | 350 | var l = new LinearGradientBrush(new Rectangle(0, 0, Width, Height + 35), Color.FromArgb(98, 115, 133), Color.Black, LinearGradientMode.Vertical); 351 | 352 | g.FillEllipse(l, new Rectangle(1, 1, 14, 14)); 353 | g.DrawEllipse(p, new Rectangle(5, 5, 5, 5)); 354 | 355 | if (Checked) 356 | g.FillEllipse(s, new Rectangle(5, 5, 5, 5)); 357 | 358 | s.Color = Helper.Colors.Foreground; 359 | g.DrawString(Text, Font, s, new PointF(20, 0)); 360 | 361 | Helper.MultiDispose(s, p, l); 362 | 363 | } 364 | } 365 | 366 | sealed class AevionCheckBox : Control 367 | { 368 | public event EventHandler CheckedChanged = delegate { }; 369 | 370 | private Boolean _Checked; 371 | 372 | public Boolean Checked 373 | { 374 | get { return _Checked; } 375 | set { 376 | _Checked = value; 377 | Invalidate(); 378 | CheckedChanged(this, new EventArgs()); 379 | } 380 | } 381 | 382 | public override string Text 383 | { 384 | get { return base.Text; } 385 | set { base.Text = value; Invalidate(); } 386 | } 387 | 388 | public override Font Font 389 | { 390 | get { return base.Font; } 391 | set { base.Font = value; Invalidate(); } 392 | } 393 | 394 | public AevionCheckBox() 395 | { 396 | DoubleBuffered = true; 397 | Font = Helper.Fonts.Primary; 398 | Size = new Size(Width, 16); 399 | } 400 | 401 | protected override void OnResize(EventArgs e) 402 | { 403 | base.OnResize(e); 404 | Size = new Size(Width, 16); 405 | } 406 | 407 | protected override void OnMouseUp(MouseEventArgs e) 408 | { 409 | base.OnMouseUp(e); 410 | Checked = !Checked; 411 | } 412 | 413 | protected override void OnPaint(PaintEventArgs e) 414 | { 415 | base.OnPaint(e); 416 | var g = e.Graphics; 417 | var s = new SolidBrush(Helper.Colors.Foreground); 418 | var l = new LinearGradientBrush(new Rectangle(0, 0, Width, Height + 35), Color.FromArgb(98, 115, 133), Color.Black, LinearGradientMode.Vertical); 419 | 420 | g.SmoothingMode = SmoothingMode.HighQuality; 421 | g.Clear(Helper.Colors.Background); 422 | 423 | g.FillRectangle(l, new Rectangle(1, 1, 13, 13)); 424 | Helper.RoundRect(g, 0, 0, 14, 14, 3, Color.FromArgb(35, 35, 40)); 425 | 426 | if (Checked) 427 | Helper.CenterString(g, "b", new Font("Marlett", 10), Helper.Colors.Foreground, new Rectangle(2, 1, 13, 13)); 428 | 429 | g.DrawString(Text, Font, s, new Point(20, -1)); 430 | 431 | Helper.MultiDispose(s, l); 432 | 433 | } 434 | } 435 | 436 | sealed class AevionProgressBar : Control 437 | { 438 | private Int32 _Maximum = 100; 439 | private Int32 _Minimum, _Value = 0; 440 | private Boolean _ShowText = true; 441 | 442 | public Int32 Maximum 443 | { 444 | get { return _Maximum; } 445 | set 446 | { 447 | if (value > Int32.MaxValue) 448 | throw new OverflowException(); 449 | if (value < _Minimum) 450 | _Minimum = value - 1; 451 | if (_Value > _Maximum) 452 | _Value = value; 453 | _Maximum = value; 454 | Invalidate(); 455 | } 456 | } 457 | 458 | public Int32 Minimum 459 | { 460 | get { return _Minimum; } 461 | set 462 | { 463 | if (value < 0) 464 | throw new ArgumentOutOfRangeException("Minimum", "Value cannot go below 0."); 465 | if (value < _Minimum) 466 | _Value = value; 467 | if (value > _Maximum) 468 | _Maximum = value + 1; 469 | _Minimum = value; 470 | Invalidate(); 471 | } 472 | } 473 | 474 | public Int32 Value 475 | { 476 | get { return _Value; } 477 | set 478 | { 479 | if (value > _Maximum) 480 | _Value = _Maximum; 481 | else if (value < _Minimum) 482 | _Value = _Minimum; 483 | else _Value = value; 484 | Invalidate(); 485 | } 486 | } 487 | 488 | public Boolean ShowText 489 | { 490 | get { return _ShowText; } 491 | set { _ShowText = value; Invalidate(); } 492 | } 493 | 494 | public override string Text 495 | { 496 | get { return base.Text; } 497 | set { base.Text = value; Invalidate(); } 498 | } 499 | 500 | public override Font Font 501 | { 502 | get { return base.Font; } 503 | set { base.Font = value; Invalidate(); } 504 | } 505 | 506 | public AevionProgressBar() 507 | { 508 | DoubleBuffered = true; 509 | Font = Helper.Fonts.Primary; 510 | } 511 | 512 | protected override void OnPaint(PaintEventArgs e) 513 | { 514 | base.OnPaint(e); 515 | var g = e.Graphics; 516 | var l = new LinearGradientBrush(new Point(0, 0), new Point(Width + Value + 50, Height), Color.FromArgb(98, 115, 133), Color.Black); 517 | 518 | g.SmoothingMode = SmoothingMode.HighQuality; 519 | g.Clear(Helper.Colors.Background); 520 | 521 | g.FillRectangle(l, new Rectangle(0, 0, (int)(Helper.ValueToPercentage(Value, Maximum, Minimum) * Width), Height)); 522 | 523 | Helper.RoundRect(g, 0, 0, Width - 1, Height - 1, 3, Color.FromArgb(38, 38, 38)); 524 | 525 | if (ShowText) 526 | Helper.CenterString(g, Text, Font, Helper.Colors.Foreground, new Rectangle(0, 0, Width, Height)); 527 | 528 | Helper.MultiDispose(l); 529 | 530 | } 531 | 532 | } 533 | 534 | sealed class AevionNotice : TextBox 535 | { 536 | 537 | public AevionNotice() 538 | { 539 | DoubleBuffered = true; 540 | Font = Helper.Fonts.Primary; 541 | Enabled = false; 542 | Multiline = true; 543 | BorderStyle = BorderStyle.None; 544 | SetStyle(ControlStyles.UserPaint | ControlStyles.SupportsTransparentBackColor, true); 545 | } 546 | 547 | protected override void OnPaint(PaintEventArgs e) 548 | { 549 | base.OnPaint(e); 550 | var g = e.Graphics; 551 | var s = new SolidBrush(Color.FromArgb(38, 38, 38)); 552 | 553 | g.SmoothingMode = SmoothingMode.HighQuality; 554 | g.Clear(Helper.Colors.Background); 555 | 556 | g.FillRectangle(s, new Rectangle(1, 1, Width - 2, Height - 2)); 557 | Helper.RoundRect(g, 0, 0, Width - 1, Height - 1, 3, Color.FromArgb(35, 35, 40)); 558 | 559 | s.Color = Helper.Colors.Foreground; 560 | g.DrawString(Text, Font, s, new Point(12, 8)); 561 | 562 | } 563 | } 564 | 565 | sealed class AevionLabel : Label 566 | { 567 | public AevionLabel() 568 | { 569 | DoubleBuffered = true; 570 | Font = Helper.Fonts.Primary; 571 | ForeColor = Helper.Colors.Foreground; 572 | BackColor = Helper.Colors.Background; 573 | } 574 | } 575 | 576 | } -------------------------------------------------------------------------------- /Windows Forms Themes/mephobia.cs: -------------------------------------------------------------------------------- 1 | //Credit to ๖ۣۜMephobia for the original theme 2 | using System; 3 | using System.ComponentModel; 4 | using System.Drawing; 5 | using System.Drawing.Drawing2D; 6 | using System.Windows.Forms; 7 | public enum MouseState : byte 8 | { 9 | None = 0, 10 | Over = 1, 11 | Down = 2, 12 | Block = 3, 13 | } 14 | public static class Draw 15 | { 16 | public static GraphicsPath RoundRect(Rectangle rect, int Curve) 17 | { 18 | GraphicsPath P = new GraphicsPath(); 19 | int ArcRectWidth = Curve * 2; 20 | P.AddArc(new Rectangle(rect.X, rect.Y, ArcRectWidth, ArcRectWidth), -180, 90); 21 | P.AddArc(new Rectangle(rect.Width - ArcRectWidth + rect.X, rect.Y, ArcRectWidth, ArcRectWidth), -90, 90); 22 | P.AddArc(new Rectangle(rect.Width - ArcRectWidth + rect.X, rect.Height - ArcRectWidth + rect.Y, ArcRectWidth, ArcRectWidth), 0, 90); 23 | P.AddArc(new Rectangle(rect.X, rect.Height - ArcRectWidth + rect.Y, ArcRectWidth, ArcRectWidth), 90, 90); 24 | P.AddLine(new Point(rect.X, rect.Height - ArcRectWidth + rect.Y), new Point(rect.X, Curve + rect.Y)); 25 | return P; 26 | } 27 | public static GraphicsPath RoundRect(int X, int Y, int Width, int Height, int Curve) 28 | { 29 | return RoundRect(new Rectangle(X, Y, Width, Height), Curve); 30 | } 31 | } 32 | public class PerplexTheme : ContainerControl 33 | { 34 | public PerplexTheme() 35 | { 36 | SetStyle(ControlStyles.SupportsTransparentBackColor, true); 37 | SetStyle(ControlStyles.UserPaint, true); 38 | BackColor = Color.FromArgb(25, 25, 25); 39 | DoubleBuffered = true; 40 | } 41 | protected override void OnPaint(PaintEventArgs e) 42 | { 43 | Bitmap B = new Bitmap(Width, Height); 44 | Graphics G = Graphics.FromImage(B); 45 | Rectangle TopLeft = new Rectangle(0, 0, Width - 125, 28); 46 | Rectangle TopRight = new Rectangle(Width - 82, 0, 81, 28); 47 | Rectangle Body = new Rectangle(10, 10, Width - 21, Height - 16); 48 | Rectangle Body2 = new Rectangle(5, 5, Width - 11, Height - 6); 49 | base.OnPaint(e); 50 | LinearGradientBrush BodyBrush = new LinearGradientBrush(Body2, Color.FromArgb(25, 25, 25), Color.FromArgb(30, 35, 48), 90); 51 | LinearGradientBrush BodyBrush2 = new LinearGradientBrush(Body, Color.FromArgb(46, 46, 46), Color.FromArgb(50, 55, 58), 120); 52 | LinearGradientBrush gloss = new LinearGradientBrush(new Rectangle(0, 0, Width - 128, 28 / 2), Color.FromArgb(240, Color.FromArgb(26, 26, 26)), Color.FromArgb(5, 255, 255, 255), 90); 53 | LinearGradientBrush gloss2 = new LinearGradientBrush(new Rectangle(Width - 82, 0,Width - 205, 28 / 2), Color.FromArgb(240, Color.FromArgb(26, 26, 26)), Color.FromArgb(5, 255, 255, 255), 90); 54 | LinearGradientBrush mainbrush = new LinearGradientBrush(TopLeft, Color.FromArgb(26, 26, 26), Color.FromArgb(30, 30, 30), 90); 55 | LinearGradientBrush mainbrush2 = new LinearGradientBrush(TopRight, Color.FromArgb(26, 26, 26), Color.FromArgb(30, 30, 30), 90); 56 | Pen P1 = new Pen(Color.FromArgb(174, 195, 30), 2); 57 | Font drawFont = new Font("Tahoma", 10, FontStyle.Bold); 58 | 59 | G.Clear(Color.Fuchsia); 60 | G.FillPath(BodyBrush, Draw.RoundRect(Body2, 3)); 61 | G.DrawPath(Pens.Black, Draw.RoundRect(Body2, 3)); 62 | 63 | G.FillPath(BodyBrush2, Draw.RoundRect(Body, 3)); 64 | G.DrawPath(Pens.Black, Draw.RoundRect(Body, 3)); 65 | 66 | G.FillPath(mainbrush, Draw.RoundRect(TopLeft, 3)); 67 | G.FillPath(gloss, Draw.RoundRect(TopLeft, 3)); 68 | G.DrawPath(Pens.Black, Draw.RoundRect(TopLeft, 3)); 69 | 70 | G.FillPath(mainbrush, Draw.RoundRect(TopRight, 3)); 71 | G.FillPath(gloss2, Draw.RoundRect(TopRight, 3)); 72 | G.DrawPath(Pens.Black, Draw.RoundRect(TopRight, 3)); 73 | 74 | G.DrawLine(P1, 14, 9, 14, 22); 75 | G.DrawLine(P1, 17, 6, 17, 25); 76 | G.DrawLine(P1, 20, 9, 20, 22); 77 | G.DrawLine(P1, 11, 12, 11, 19); 78 | G.DrawLine(P1, 23, 12, 23, 19); 79 | G.DrawLine(P1, 8, 14, 8, 17); 80 | G.DrawLine(P1, 26, 14, 26, 17); 81 | G.DrawString(Text, drawFont, new SolidBrush(Color.WhiteSmoke), new Rectangle(32, 1, Width - 1, 27), new StringFormat() { Alignment = StringAlignment.Near, LineAlignment = StringAlignment.Center }); 82 | e.Graphics.DrawImage((Image)B.Clone(), 0, 0); 83 | G.Dispose(); 84 | B.Dispose(); 85 | } 86 | private Point MouseP = new Point(0, 0); 87 | private bool cap = false; 88 | private int moveheight = 29; 89 | protected override void OnMouseDown(MouseEventArgs e) 90 | { 91 | base.OnMouseDown(e); 92 | if (e.Button == MouseButtons.Left && new Rectangle(0, 0, Width, moveheight).Contains(e.Location)) 93 | { 94 | cap = true; 95 | MouseP = e.Location; 96 | } 97 | } 98 | protected override void OnMouseUp(MouseEventArgs e) 99 | { 100 | base.OnMouseUp(e); 101 | cap = false; 102 | } 103 | protected override void OnMouseMove(MouseEventArgs e) 104 | { 105 | base.OnMouseMove(e); 106 | if (cap) 107 | { 108 | Point p = new Point(); 109 | p.X = MousePosition.X - MouseP.X; 110 | p.Y = MousePosition.Y - MouseP.Y; 111 | Parent.Location = p; 112 | } 113 | } 114 | protected override void OnCreateControl() 115 | { 116 | base.OnCreateControl(); 117 | ParentForm.FormBorderStyle = FormBorderStyle.None; 118 | ParentForm.TransparencyKey = Color.Fuchsia; 119 | Dock = DockStyle.Fill; 120 | } 121 | } 122 | public class PerplexButton : Control 123 | { 124 | MouseState State = MouseState.None; 125 | protected override void OnMouseDown(MouseEventArgs e) 126 | { 127 | base.OnMouseDown(e); 128 | State = MouseState.Down; 129 | Invalidate(); 130 | } 131 | protected override void OnMouseUp(MouseEventArgs e) 132 | { 133 | base.OnMouseUp(e); 134 | State = MouseState.Over; 135 | Invalidate(); 136 | } 137 | protected override void OnMouseEnter(EventArgs e) 138 | { 139 | base.OnMouseEnter(e); 140 | State = MouseState.Over; 141 | Invalidate(); 142 | } 143 | protected override void OnMouseLeave(EventArgs e) 144 | { 145 | base.OnMouseLeave(e); 146 | State = MouseState.None; 147 | Invalidate(); 148 | } 149 | public PerplexButton() 150 | { 151 | SetStyle(ControlStyles.SupportsTransparentBackColor, true); 152 | SetStyle(ControlStyles.UserPaint, true); 153 | BackColor = Color.Transparent; 154 | ForeColor = Color.FromArgb(205, 205, 205); 155 | DoubleBuffered = true; 156 | } 157 | 158 | protected override void OnPaint(PaintEventArgs e) 159 | { 160 | Bitmap B = new Bitmap(Width, Height); 161 | Graphics G = Graphics.FromImage(B); 162 | Rectangle ClientRectangle = new Rectangle(0, 0, Width - 1, Height - 1); 163 | base.OnPaint(e); 164 | G.Clear(BackColor); 165 | Font drawFont = new Font("Tahoma", 8, FontStyle.Bold); 166 | G.SmoothingMode = SmoothingMode.HighQuality; 167 | Rectangle R1 = new Rectangle(0, 0, Width - 125, 35 / 2); 168 | Rectangle R2 = new Rectangle(5, Height - 10, Width - 11, 5); 169 | Rectangle R3 = new Rectangle(6, Height - 9, Width - 13, 3); 170 | Rectangle R4 = new Rectangle(1, 1, Width - 3, Height - 3); 171 | Rectangle R5 = new Rectangle(1, 0, Width - 1, Height - 1); 172 | Rectangle R6 = new Rectangle(0, -1, Width - 1, Height - 1); 173 | LinearGradientBrush lgb = new LinearGradientBrush(ClientRectangle, Color.FromArgb(66, 67, 70), Color.FromArgb(43, 44, 48), 90); 174 | LinearGradientBrush botbar = new LinearGradientBrush(R2, Color.FromArgb(44, 45, 49), Color.FromArgb(45, 46, 50), 90); 175 | LinearGradientBrush fill = new LinearGradientBrush(R3, Color.FromArgb(174, 195, 30), Color.FromArgb(141, 153, 16), 90); 176 | LinearGradientBrush gloss = null; 177 | Pen o = new Pen(Color.FromArgb(50, 50, 50), 1); 178 | StringFormat format = new StringFormat() { Alignment = StringAlignment.Center, LineAlignment = StringAlignment.Center }; 179 | if (State == MouseState.Over) 180 | gloss = new LinearGradientBrush(R1, Color.FromArgb(15, Color.FromArgb(26, 26, 26)), Color.FromArgb(1, 255, 255, 255), 90); 181 | else if (State == MouseState.Down) 182 | gloss = new LinearGradientBrush(R1, Color.FromArgb(100, Color.FromArgb(26, 26, 26)), Color.FromArgb(1, 255, 255, 255), 90); 183 | else 184 | gloss = new LinearGradientBrush(R1, Color.FromArgb(75, Color.FromArgb(26, 26, 26)), Color.FromArgb(3, 255, 255, 255), 90); 185 | 186 | G.FillPath(lgb, Draw.RoundRect(ClientRectangle, 2)); 187 | G.FillPath(gloss, Draw.RoundRect(ClientRectangle, 2)); 188 | G.FillPath(botbar, Draw.RoundRect(R2, 1)); 189 | G.FillPath(fill, Draw.RoundRect(R3, 1)); 190 | G.DrawPath(o, Draw.RoundRect(ClientRectangle, 2)); 191 | G.DrawPath(Pens.Black, Draw.RoundRect(R4, 2)); 192 | G.DrawString(Text, drawFont, new SolidBrush(Color.FromArgb(5, 5, 5)), R5, format); 193 | G.DrawString(Text, drawFont, new SolidBrush(Color.FromArgb(205, 205, 205)), R6, format); 194 | 195 | e.Graphics.DrawImage((Image)B.Clone(), 0, 0); 196 | G.Dispose(); 197 | B.Dispose(); 198 | } 199 | } 200 | public class PerplexControlBox : Control 201 | { 202 | MouseState State = MouseState.None; 203 | Rectangle MinBtn = new Rectangle(0, 0, 20, 20); 204 | Rectangle MaxBtn = new Rectangle(25, 0, 20, 20); 205 | int x = 0; 206 | 207 | protected override void OnMouseDown(MouseEventArgs e) 208 | { 209 | base.OnMouseDown(e); 210 | if (e.Location.X > 0 && e.Location.X < 20) 211 | FindForm().WindowState = FormWindowState.Minimized; 212 | else if (e.Location.X > 25 && e.Location.X < 45) 213 | FindForm().Close(); 214 | State = MouseState.Down; 215 | Invalidate(); 216 | } 217 | protected override void OnMouseUp(MouseEventArgs e) 218 | { 219 | base.OnMouseUp(e); 220 | State = MouseState.Over; 221 | Invalidate(); 222 | } 223 | protected override void OnMouseEnter(EventArgs e) 224 | { 225 | base.OnMouseEnter(e); 226 | State = MouseState.Over; 227 | Invalidate(); 228 | } 229 | protected override void OnMouseLeave(EventArgs e) 230 | { 231 | base.OnMouseLeave(e); 232 | State = MouseState.None; 233 | Invalidate(); 234 | } 235 | public PerplexControlBox() 236 | { 237 | SetStyle(ControlStyles.SupportsTransparentBackColor, true); 238 | SetStyle(ControlStyles.UserPaint, true); 239 | BackColor = Color.Transparent; 240 | ForeColor = Color.FromArgb(205, 205, 205); 241 | DoubleBuffered = true; 242 | } 243 | protected override void OnPaint(PaintEventArgs e) 244 | { 245 | Bitmap B = new Bitmap(Width, Height); 246 | Graphics G = Graphics.FromImage(B); 247 | base.OnPaint(e); 248 | G.Clear(BackColor); 249 | G.SmoothingMode = SmoothingMode.HighQuality; 250 | 251 | LinearGradientBrush mlgb = null; 252 | Font mf = new Font("Marlett", 9); 253 | SolidBrush mfb = new SolidBrush(Color.FromArgb(174, 195, 30)); 254 | Pen P1 = new Pen(Color.FromArgb(21, 21, 21), 1); 255 | Color C1 = Color.FromArgb(66, 67, 70); 256 | Color C2 = Color.FromArgb(43, 44, 48); 257 | GraphicsPath GP1 = Draw.RoundRect(MinBtn, 4); 258 | GraphicsPath GP2 = Draw.RoundRect(MaxBtn, 4); 259 | switch (State) 260 | { 261 | case MouseState.None: 262 | mlgb = new LinearGradientBrush(MinBtn, C1, C2, 90); 263 | G.FillPath(mlgb, GP1); 264 | G.DrawPath(P1, GP1); 265 | G.DrawString("0", mf, mfb, 4, 4); 266 | 267 | G.FillPath(mlgb, GP2); 268 | G.DrawPath(P1, GP2); 269 | G.DrawString("r", mf, mfb, 28, 4); 270 | break; 271 | case MouseState.Over: 272 | if (x > 0 && x < 20) 273 | { 274 | mlgb = new LinearGradientBrush(MinBtn, Color.FromArgb(100, C1), Color.FromArgb(100, C2), 90); 275 | G.FillPath(mlgb, GP1); 276 | G.DrawPath(P1, GP1); 277 | G.DrawString("0", mf, mfb, 4, 4); 278 | 279 | mlgb = new LinearGradientBrush(MaxBtn, C1, C2, 90); 280 | G.FillPath(mlgb, Draw.RoundRect(MaxBtn, 4)); 281 | G.DrawPath(P1, GP2); 282 | G.DrawString("r", mf, mfb, 4, 4); 283 | } 284 | else if (x > 25 && x < 45) 285 | { 286 | mlgb = new LinearGradientBrush(MinBtn, C1, C2, 90); 287 | G.FillPath(mlgb, GP1); 288 | G.DrawPath(P1, GP1); 289 | G.DrawString("0", mf, mfb, 4, 4); 290 | mlgb = new LinearGradientBrush(MaxBtn, Color.FromArgb(100, C1), Color.FromArgb(100, C2), 90); 291 | G.FillPath(mlgb, GP2); 292 | G.DrawPath(P1, GP2); 293 | G.DrawString("r", mf, mfb, 28, 4); 294 | } 295 | else 296 | { 297 | mlgb = new LinearGradientBrush(MinBtn, C1, C2, 90); 298 | G.FillPath(mlgb, GP1); 299 | G.DrawPath(P1, GP1); 300 | G.DrawString("0", mf, mfb, 4, 4); 301 | 302 | LinearGradientBrush lgb = new LinearGradientBrush(MaxBtn, C1, C2, 90); 303 | G.FillPath(lgb, GP2); 304 | G.DrawPath(P1, GP2); 305 | G.DrawString("r", mf, mfb, 28, 4); 306 | } 307 | break; 308 | case MouseState.Down: 309 | mlgb = new LinearGradientBrush(MinBtn, C1, C2, 90); 310 | G.FillPath(mlgb, GP1); 311 | G.DrawPath(P1, GP1); 312 | G.DrawString("0", mf, mfb, 4, 4); 313 | 314 | mlgb = new LinearGradientBrush(MaxBtn, C1, C2, 90); 315 | G.FillPath(mlgb, GP2); 316 | G.DrawPath(P1, GP2); 317 | G.DrawString("r", mf, mfb, 28, 4); 318 | break; 319 | default: 320 | mlgb = new LinearGradientBrush(MinBtn, C1, C2, 90); 321 | G.FillPath(mlgb, GP1); 322 | G.DrawPath(P1, GP1); 323 | G.DrawString("0", mf, mfb, 4, 4); 324 | 325 | mlgb = new LinearGradientBrush(MaxBtn, C1, C2, 90); 326 | G.FillPath(mlgb, GP2); 327 | G.DrawPath(P1, GP2); 328 | G.DrawString("r", mf, mfb, 28, 4); 329 | break; 330 | } 331 | e.Graphics.DrawImage((Image)B.Clone(), 0, 0); 332 | G.Dispose(); 333 | B.Dispose(); 334 | } 335 | } 336 | public class PerplexGroupBox : ContainerControl 337 | { 338 | public PerplexGroupBox() 339 | { 340 | SetStyle(ControlStyles.SupportsTransparentBackColor, true); 341 | BackColor = Color.Transparent; 342 | DoubleBuffered = true; 343 | } 344 | protected override void OnPaint(PaintEventArgs e) 345 | { 346 | Bitmap B = new Bitmap(Width, Height); 347 | Graphics G = Graphics.FromImage(B); 348 | Rectangle Body = new Rectangle(4, 25, Width - 9, Height - 30); 349 | Rectangle Body2 = new Rectangle(0, 0, Width - 1, Height - 1); 350 | base.OnPaint(e); 351 | G.Clear(Color.Transparent); 352 | G.SmoothingMode = SmoothingMode.HighQuality; 353 | G.CompositingQuality = CompositingQuality.HighQuality; 354 | 355 | Pen P1 = new Pen(Color.Black); 356 | LinearGradientBrush BodyBrush = new LinearGradientBrush(Body2, Color.FromArgb(26, 26, 26), Color.FromArgb(30, 30, 30), 90); 357 | LinearGradientBrush BodyBrush2 = new LinearGradientBrush(Body, Color.FromArgb(46, 46, 46), Color.FromArgb(50, 55, 58), 120); 358 | Font drawFont = new Font("Tahoma", 9, FontStyle.Bold); 359 | G.FillPath(BodyBrush, Draw.RoundRect(Body2, 3)); 360 | G.DrawPath(P1, Draw.RoundRect(Body2, 3)); 361 | 362 | G.FillPath(BodyBrush2, Draw.RoundRect(Body, 3)); 363 | G.DrawPath(P1, Draw.RoundRect(Body, 3)); 364 | 365 | G.DrawString(Text, drawFont, new SolidBrush(Color.WhiteSmoke), 67, 14, new StringFormat() { Alignment = StringAlignment.Center, LineAlignment = StringAlignment.Center }); 366 | e.Graphics.DrawImage((Image)B.Clone(), 0, 0); 367 | G.Dispose(); 368 | B.Dispose(); 369 | } 370 | } 371 | public class PerplexProgressBar : Control 372 | { 373 | private int _Maximum = 100; 374 | 375 | public int Maximum { 376 | get { return _Maximum; } 377 | set { 378 | _Maximum = value; 379 | Invalidate(); 380 | } 381 | } 382 | private int _Value = 0; 383 | public int Value 384 | { 385 | get 386 | { 387 | if (_Value == 0) 388 | return 0; 389 | else return _Value; 390 | } 391 | set 392 | { 393 | _Value = value; 394 | if (_Value > _Maximum) 395 | _Value = _Maximum; 396 | Invalidate(); 397 | } 398 | } 399 | private bool _ShowPercentage = false; 400 | public bool ShowPercentage { 401 | get { return _ShowPercentage; } 402 | set { 403 | _ShowPercentage = value; 404 | Invalidate(); 405 | } 406 | } 407 | 408 | public PerplexProgressBar() : base() 409 | { 410 | DoubleBuffered = true; 411 | SetStyle(ControlStyles.SupportsTransparentBackColor, true); 412 | SetStyle(ControlStyles.UserPaint, true); 413 | BackColor = Color.Transparent; 414 | } 415 | 416 | protected override void OnPaint(PaintEventArgs e) 417 | { 418 | Bitmap B = new Bitmap(Width, Height); 419 | Graphics G = Graphics.FromImage(B); 420 | 421 | G.SmoothingMode = SmoothingMode.HighQuality; 422 | 423 | double val = (double)_Value / _Maximum; 424 | int intValue = Convert.ToInt32(val * Width); 425 | G.Clear(BackColor); 426 | Color C1 = Color.FromArgb(174, 195, 30); 427 | Color C2 = Color.FromArgb(141, 153, 16); 428 | Rectangle R1 = new Rectangle(0, 0, Width - 1, Height - 1); 429 | Rectangle R2 = new Rectangle(0, 0, intValue - 1, Height - 1); 430 | Rectangle R3 = new Rectangle(0, 0, intValue - 1, Height - 2); 431 | GraphicsPath GP1 = Draw.RoundRect(R1, 1); 432 | GraphicsPath GP2 = Draw.RoundRect(R2, 2); 433 | GraphicsPath GP3 = Draw.RoundRect(R3, 1); 434 | LinearGradientBrush gB = new LinearGradientBrush(R1, Color.FromArgb(26, 26, 26), Color.FromArgb(30, 30, 30), 90); 435 | LinearGradientBrush g1 = new LinearGradientBrush(new Rectangle(2, 2, intValue - 1, Height - 2), C1, C2, 90); 436 | HatchBrush h1 = new HatchBrush(HatchStyle.DarkUpwardDiagonal, Color.FromArgb(50, C1), Color.FromArgb(25, C2)); 437 | Pen P1 = new Pen(Color.Black); 438 | 439 | G.FillPath(gB, GP1); 440 | G.FillPath(g1, GP3); 441 | G.FillPath(h1, GP3); 442 | G.DrawPath(P1, GP1); 443 | G.DrawPath(new Pen(Color.FromArgb(150, 97, 94, 90)), GP2); 444 | G.DrawPath(P1, GP2); 445 | 446 | if (_ShowPercentage) 447 | G.DrawString(Convert.ToString(string.Concat(Value, "%")), Font, Brushes.White, R1, new StringFormat { Alignment = StringAlignment.Center, LineAlignment = StringAlignment.Center }); 448 | 449 | e.Graphics.DrawImage((Image)B.Clone(), 0, 0); 450 | G.Dispose(); 451 | B.Dispose(); 452 | } 453 | } 454 | [DefaultEvent("CheckedChanged")] 455 | public class PerplexCheckBox : Control 456 | { 457 | MouseState State = MouseState.None; 458 | protected override void OnMouseDown(MouseEventArgs e) 459 | { 460 | base.OnMouseDown(e); 461 | State = MouseState.Down; 462 | Invalidate(); 463 | } 464 | protected override void OnMouseUp(MouseEventArgs e) 465 | { 466 | base.OnMouseUp(e); 467 | State = MouseState.Over; 468 | Invalidate(); 469 | } 470 | protected override void OnMouseEnter(EventArgs e) 471 | { 472 | base.OnMouseEnter(e); 473 | State = MouseState.Over; 474 | Invalidate(); 475 | } 476 | protected override void OnMouseLeave(EventArgs e) 477 | { 478 | base.OnMouseLeave(e); 479 | State = MouseState.None; 480 | Invalidate(); 481 | } 482 | protected override void OnSizeChanged(EventArgs e) 483 | { 484 | base.OnSizeChanged(e); 485 | Height = 16; 486 | } 487 | protected override void OnTextChanged(EventArgs e) 488 | { 489 | base.OnTextChanged(e); 490 | Invalidate(); 491 | } 492 | protected override void OnClick(EventArgs e) 493 | { 494 | _Checked = !_Checked; 495 | if (CheckedChanged != null) 496 | CheckedChanged(this, EventArgs.Empty); 497 | base.OnClick(e); 498 | } 499 | private bool _Checked = false; 500 | public bool Checked 501 | { 502 | get { return _Checked; } 503 | set 504 | { 505 | _Checked = value; 506 | if (CheckedChanged != null) 507 | CheckedChanged(this, EventArgs.Empty); 508 | Invalidate(); 509 | } 510 | } 511 | public PerplexCheckBox() 512 | { 513 | SetStyle(ControlStyles.SupportsTransparentBackColor, true); 514 | SetStyle(ControlStyles.UserPaint, true); 515 | BackColor = Color.Transparent; 516 | ForeColor = Color.Black; 517 | Size = new Size(145, 16); 518 | DoubleBuffered = true; 519 | } 520 | protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) 521 | { 522 | Bitmap B = new Bitmap(Width, Height); 523 | Graphics G = Graphics.FromImage(B); 524 | G.SmoothingMode = SmoothingMode.HighQuality; 525 | G.CompositingQuality = CompositingQuality.HighQuality; 526 | Rectangle checkBoxRectangle = new Rectangle(0, 0, Height - 1, Height - 1); 527 | LinearGradientBrush bodyGrad = new LinearGradientBrush(checkBoxRectangle, Color.FromArgb(174, 195, 30), Color.FromArgb(141, 153, 16), 90); 528 | SolidBrush nb = new SolidBrush(Color.FromArgb(205, 205, 205)); 529 | StringFormat format = new StringFormat() { Alignment = StringAlignment.Near, LineAlignment = StringAlignment.Center }; 530 | Font drawFont = new Font("Tahoma", 9, FontStyle.Bold); 531 | G.Clear(BackColor); 532 | G.FillRectangle(bodyGrad, bodyGrad.Rectangle); 533 | G.DrawRectangle(new Pen(Color.Black), checkBoxRectangle); 534 | G.DrawString(Text, drawFont, Brushes.Black, new Point(17, 9), format); 535 | G.DrawString(Text, drawFont, nb, new Point(16, 8), format); 536 | 537 | if (_Checked) 538 | { 539 | Rectangle chkPoly = new Rectangle(checkBoxRectangle.X + checkBoxRectangle.Width / 4, checkBoxRectangle.Y + checkBoxRectangle.Height / 4, checkBoxRectangle.Width / 2, checkBoxRectangle.Height / 2); 540 | Point[] p = new Point[] {new Point(chkPoly.X, chkPoly.Y + chkPoly.Height /2), 541 | new Point(chkPoly.X + chkPoly.Width / 2, chkPoly.Y + chkPoly.Height), 542 | new Point(chkPoly.X + chkPoly.Width, chkPoly.Y)}; 543 | Pen P1 = new Pen(Color.FromArgb(12, 12, 12), 2); 544 | for (int i = 0; i <= p.Length - 2; i++) 545 | G.DrawLine(P1, p[i], p[i + 1]); 546 | } 547 | e.Graphics.DrawImage((Image)B.Clone(), 0, 0); 548 | G.Dispose(); 549 | B.Dispose(); 550 | } 551 | 552 | public event EventHandler CheckedChanged; 553 | } 554 | [DefaultEvent("CheckedChanged")] 555 | public class PerplexRadioButton : Control 556 | { 557 | MouseState State = MouseState.None; 558 | protected override void OnMouseDown(MouseEventArgs e) 559 | { 560 | base.OnMouseDown(e); 561 | State = MouseState.Down; 562 | Invalidate(); 563 | } 564 | protected override void OnMouseUp(MouseEventArgs e) 565 | { 566 | base.OnMouseUp(e); 567 | State = MouseState.Over; 568 | Invalidate(); 569 | } 570 | protected override void OnMouseEnter(EventArgs e) 571 | { 572 | base.OnMouseEnter(e); 573 | State = MouseState.Over; 574 | Invalidate(); 575 | } 576 | protected override void OnMouseLeave(EventArgs e) 577 | { 578 | base.OnMouseLeave(e); 579 | State = MouseState.None; 580 | Invalidate(); 581 | } 582 | protected override void OnSizeChanged(EventArgs e) 583 | { 584 | base.OnSizeChanged(e); 585 | Height = 16; 586 | } 587 | protected override void OnTextChanged(EventArgs e) 588 | { 589 | base.OnTextChanged(e); 590 | Invalidate(); 591 | } 592 | protected override void OnClick(EventArgs e) 593 | { 594 | Checked = !Checked; 595 | base.OnClick(e); 596 | } 597 | private bool _Checked = false; 598 | public bool Checked 599 | { 600 | get { return _Checked; } 601 | set 602 | { 603 | _Checked = value; 604 | InvalidateControls(); 605 | if (CheckedChanged != null) 606 | CheckedChanged(this, EventArgs.Empty); 607 | Invalidate(); 608 | } 609 | } 610 | protected override void OnCreateControl() 611 | { 612 | base.OnCreateControl(); 613 | InvalidateControls(); 614 | } 615 | private void InvalidateControls() 616 | { 617 | if (!IsHandleCreated || !_Checked) return; 618 | foreach (Control C in Parent.Controls) 619 | if (C is PerplexRadioButton && C != this) 620 | ((PerplexRadioButton)C).Checked = false; 621 | } 622 | public PerplexRadioButton() 623 | { 624 | SetStyle(ControlStyles.SupportsTransparentBackColor, true); 625 | SetStyle(ControlStyles.UserPaint, true); 626 | BackColor = Color.Transparent; 627 | ForeColor = Color.Black; 628 | Size = new Size(150, 16); 629 | DoubleBuffered = true; 630 | } 631 | protected override void OnPaint(PaintEventArgs e) 632 | { 633 | Bitmap B = new Bitmap(Width, Height); 634 | Graphics G = Graphics.FromImage(B); 635 | G.Clear(BackColor); 636 | Rectangle radioBtnRectangle = new Rectangle(0, 0, Height - 1, Height - 1); 637 | Rectangle R1 = new Rectangle(4, 4, Height - 9, Height - 9); 638 | StringFormat format = new StringFormat() { Alignment = StringAlignment.Near, LineAlignment = StringAlignment.Near }; 639 | LinearGradientBrush bgGrad = new LinearGradientBrush(radioBtnRectangle, Color.FromArgb(174, 195, 30), Color.FromArgb(141, 153, 16), 90); 640 | Color C1 = Color.FromArgb(250, 15, 15, 15); 641 | SolidBrush nb = new SolidBrush(Color.FromArgb(205, 205, 205)); 642 | G.SmoothingMode = SmoothingMode.HighQuality; 643 | G.CompositingQuality = CompositingQuality.HighQuality; 644 | Font drawFont = new Font("Tahoma", 10, FontStyle.Bold); 645 | 646 | G.FillEllipse(bgGrad, radioBtnRectangle); 647 | G.DrawEllipse(new Pen(Color.Black), radioBtnRectangle); 648 | 649 | if (Checked) 650 | { 651 | LinearGradientBrush chkGrad = new LinearGradientBrush(R1, C1, C1, 90); 652 | G.FillEllipse(chkGrad, R1); 653 | } 654 | 655 | G.DrawString(Text, drawFont, Brushes.Black, new Point(17, 2), format); 656 | G.DrawString(Text, drawFont, nb, new Point(16, 1), format); 657 | 658 | e.Graphics.DrawImage((Image)B.Clone(), 0, 0); 659 | G.Dispose(); 660 | B.Dispose(); 661 | } 662 | public event EventHandler CheckedChanged; 663 | } 664 | public class PerplexLabel : Control 665 | { 666 | public PerplexLabel() 667 | { 668 | SetStyle(ControlStyles.SupportsTransparentBackColor, true); 669 | SetStyle(ControlStyles.UserPaint, true); 670 | BackColor = Color.Transparent; 671 | ForeColor = Color.FromArgb(205, 205, 205); 672 | DoubleBuffered = true; 673 | } 674 | protected override void OnPaint(PaintEventArgs e) 675 | { 676 | Bitmap B = new Bitmap(Width, Height); 677 | Graphics G = Graphics.FromImage(B); 678 | Rectangle ClientRectangle = new Rectangle(0, 0, Width - 1, Height - 1); 679 | base.OnPaint(e); 680 | G.Clear(BackColor); 681 | Font drawFont = new Font("Tahoma", 9, FontStyle.Bold); 682 | StringFormat format = new StringFormat() { Alignment = StringAlignment.Near, LineAlignment = StringAlignment.Center}; 683 | G.CompositingQuality = CompositingQuality.HighQuality; 684 | G.SmoothingMode = SmoothingMode.HighQuality; 685 | G.DrawString(Text, drawFont, new SolidBrush(Color.FromArgb(5, 5, 5)), new Rectangle(1, 0, Width - 1, Height - 1), format); 686 | G.DrawString(Text, drawFont, new SolidBrush(Color.FromArgb(205, 205, 205)), new Rectangle(0, -1, Width - 1, Height - 1), format); 687 | e.Graphics.DrawImage((Image)B.Clone(), 0, 0); 688 | G.Dispose(); 689 | B.Dispose(); 690 | } 691 | } -------------------------------------------------------------------------------- /Windows Forms Themes/Tweety.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Forms; 3 | using System.Drawing.Drawing2D; 4 | using System.ComponentModel; 5 | using System.Runtime.InteropServices; 6 | using System.Drawing; 7 | 8 | //.::Tweety Theme::. 9 | //Author: UnReLaTeDScript 10 | //Credits: Aeonhack [Themebase] 11 | //Version: 1.0 12 | abstract class Theme : ContainerControl 13 | { 14 | 15 | #region " Initialization " 16 | 17 | protected Graphics G; 18 | public Theme() 19 | { 20 | SetStyle((ControlStyles)139270, true); 21 | } 22 | 23 | private bool ParentIsForm; 24 | protected override void OnHandleCreated(EventArgs e) 25 | { 26 | Dock = DockStyle.Fill; 27 | ParentIsForm = Parent is Form; 28 | if (ParentIsForm) 29 | { 30 | if (!(_TransparencyKey == Color.Empty)) 31 | ParentForm.TransparencyKey = _TransparencyKey; 32 | ParentForm.FormBorderStyle = FormBorderStyle.None; 33 | } 34 | base.OnHandleCreated(e); 35 | } 36 | 37 | public override string Text 38 | { 39 | get { return base.Text; } 40 | set 41 | { 42 | base.Text = value; 43 | Invalidate(); 44 | } 45 | } 46 | #endregion 47 | 48 | #region " Sizing and Movement " 49 | 50 | private bool _Resizable = true; 51 | public bool Resizable 52 | { 53 | get { return _Resizable; } 54 | set { _Resizable = value; } 55 | } 56 | 57 | private int _MoveHeight = 24; 58 | public int MoveHeight 59 | { 60 | get { return _MoveHeight; } 61 | set 62 | { 63 | _MoveHeight = value; 64 | Header = new Rectangle(7, 7, Width - 14, _MoveHeight - 7); 65 | } 66 | } 67 | 68 | private IntPtr Flag; 69 | protected override void OnMouseDown(MouseEventArgs e) 70 | { 71 | if (!(e.Button == MouseButtons.Left)) 72 | return; 73 | if (ParentIsForm) 74 | if (ParentForm.WindowState == FormWindowState.Maximized) 75 | return; 76 | 77 | if (Header.Contains(e.Location)) 78 | { 79 | Flag = new IntPtr(2); 80 | } 81 | else if (Current.Position == 0 | !_Resizable) 82 | { 83 | return; 84 | } 85 | else 86 | { 87 | Flag = new IntPtr(Current.Position); 88 | } 89 | 90 | Capture = false; 91 | Message m = Message.Create(Parent.Handle, 161, Flag, IntPtr.Zero); 92 | DefWndProc(ref m); 93 | 94 | base.OnMouseDown(e); 95 | } 96 | 97 | private struct Pointer 98 | { 99 | public readonly Cursor Cursor; 100 | public readonly byte Position; 101 | public Pointer(Cursor c, byte p) 102 | { 103 | Cursor = c; 104 | Position = p; 105 | } 106 | } 107 | 108 | private bool F1; 109 | private bool F2; 110 | private bool F3; 111 | private bool F4; 112 | private Point PTC; 113 | private Pointer GetPointer() 114 | { 115 | PTC = PointToClient(MousePosition); 116 | F1 = PTC.X < 7; 117 | F2 = PTC.X > Width - 7; 118 | F3 = PTC.Y < 7; 119 | F4 = PTC.Y > Height - 7; 120 | 121 | if (F1 & F3) 122 | return new Pointer(Cursors.SizeNWSE, 13); 123 | if (F1 & F4) 124 | return new Pointer(Cursors.SizeNESW, 16); 125 | if (F2 & F3) 126 | return new Pointer(Cursors.SizeNESW, 14); 127 | if (F2 & F4) 128 | return new Pointer(Cursors.SizeNWSE, 17); 129 | if (F1) 130 | return new Pointer(Cursors.SizeWE, 10); 131 | if (F2) 132 | return new Pointer(Cursors.SizeWE, 11); 133 | if (F3) 134 | return new Pointer(Cursors.SizeNS, 12); 135 | if (F4) 136 | return new Pointer(Cursors.SizeNS, 15); 137 | return new Pointer(Cursors.Default, 0); 138 | } 139 | 140 | private Pointer Current; 141 | private Pointer Pending; 142 | private void SetCurrent() 143 | { 144 | Pending = GetPointer(); 145 | if (Current.Position == Pending.Position) 146 | return; 147 | Current = GetPointer(); 148 | Cursor = Current.Cursor; 149 | } 150 | 151 | protected override void OnMouseMove(MouseEventArgs e) 152 | { 153 | if (_Resizable) 154 | SetCurrent(); 155 | base.OnMouseMove(e); 156 | } 157 | 158 | protected Rectangle Header; 159 | protected override void OnSizeChanged(EventArgs e) 160 | { 161 | if (Width == 0 || Height == 0) 162 | return; 163 | Header = new Rectangle(7, 7, Width - 14, _MoveHeight - 7); 164 | Invalidate(); 165 | base.OnSizeChanged(e); 166 | } 167 | 168 | #endregion 169 | 170 | #region " Convienence " 171 | 172 | public abstract void PaintHook(); 173 | protected override sealed void OnPaint(PaintEventArgs e) 174 | { 175 | if (Width == 0 || Height == 0) 176 | return; 177 | G = e.Graphics; 178 | PaintHook(); 179 | } 180 | 181 | private Color _TransparencyKey; 182 | public Color TransparencyKey 183 | { 184 | get { return _TransparencyKey; } 185 | set 186 | { 187 | _TransparencyKey = value; 188 | Invalidate(); 189 | } 190 | } 191 | 192 | private Image _Image; 193 | public Image Image 194 | { 195 | get { return _Image; } 196 | set 197 | { 198 | _Image = value; 199 | Invalidate(); 200 | } 201 | } 202 | public int ImageWidth 203 | { 204 | get 205 | { 206 | if (_Image == null) 207 | return 0; 208 | return _Image.Width; 209 | } 210 | } 211 | 212 | private Size _Size; 213 | private Rectangle _Rectangle; 214 | private LinearGradientBrush _Gradient; 215 | 216 | private SolidBrush _Brush; 217 | protected void DrawCorners(Color c, Rectangle rect) 218 | { 219 | _Brush = new SolidBrush(c); 220 | G.FillRectangle(_Brush, rect.X, rect.Y, 1, 1); 221 | G.FillRectangle(_Brush, rect.X + (rect.Width - 1), rect.Y, 1, 1); 222 | G.FillRectangle(_Brush, rect.X, rect.Y + (rect.Height - 1), 1, 1); 223 | G.FillRectangle(_Brush, rect.X + (rect.Width - 1), rect.Y + (rect.Height - 1), 1, 1); 224 | } 225 | 226 | protected void DrawBorders(Pen p1, Pen p2, Rectangle rect) 227 | { 228 | G.DrawRectangle(p1, rect.X, rect.Y, rect.Width - 1, rect.Height - 1); 229 | G.DrawRectangle(p2, rect.X + 1, rect.Y + 1, rect.Width - 3, rect.Height - 3); 230 | } 231 | 232 | protected void DrawText(HorizontalAlignment a, Color c, int x) 233 | { 234 | DrawText(a, c, x, 0); 235 | } 236 | protected void DrawText(HorizontalAlignment a, Color c, int x, int y) 237 | { 238 | if (string.IsNullOrEmpty(Text)) 239 | return; 240 | _Size = G.MeasureString(Text, Font).ToSize(); 241 | _Brush = new SolidBrush(c); 242 | 243 | switch (a) 244 | { 245 | case HorizontalAlignment.Left: 246 | G.DrawString(Text, Font, _Brush, x, _MoveHeight / 2 - _Size.Height / 2 + y); 247 | break; 248 | case HorizontalAlignment.Right: 249 | G.DrawString(Text, Font, _Brush, Width - _Size.Width - x, _MoveHeight / 2 - _Size.Height / 2 + y); 250 | break; 251 | case HorizontalAlignment.Center: 252 | G.DrawString(Text, Font, _Brush, Width / 2 - _Size.Width / 2 + x, _MoveHeight / 2 - _Size.Height / 2 + y); 253 | break; 254 | } 255 | } 256 | 257 | protected void DrawIcon(HorizontalAlignment a, int x) 258 | { 259 | DrawIcon(a, x, 0); 260 | } 261 | protected void DrawIcon(HorizontalAlignment a, int x, int y) 262 | { 263 | if (_Image == null) 264 | return; 265 | switch (a) 266 | { 267 | case HorizontalAlignment.Left: 268 | G.DrawImage(_Image, x, _MoveHeight / 2 - _Image.Height / 2 + y); 269 | break; 270 | case HorizontalAlignment.Right: 271 | G.DrawImage(_Image, Width - _Image.Width - x, _MoveHeight / 2 - _Image.Height / 2 + y); 272 | break; 273 | case HorizontalAlignment.Center: 274 | G.DrawImage(_Image, Width / 2 - _Image.Width / 2, _MoveHeight / 2 - _Image.Height / 2); 275 | break; 276 | } 277 | } 278 | 279 | protected void DrawGradient(Color c1, Color c2, int x, int y, int width, int height, float angle) 280 | { 281 | _Rectangle = new Rectangle(x, y, width, height); 282 | _Gradient = new LinearGradientBrush(_Rectangle, c1, c2, angle); 283 | G.FillRectangle(_Gradient, _Rectangle); 284 | } 285 | 286 | #endregion 287 | 288 | } 289 | static class Draw 290 | { 291 | public static GraphicsPath RoundRect(Rectangle Rectangle, int Curve) 292 | { 293 | GraphicsPath P = new GraphicsPath(); 294 | int ArcRectangleWidth = Curve * 2; 295 | P.AddArc(new Rectangle(Rectangle.X, Rectangle.Y, ArcRectangleWidth, ArcRectangleWidth), -180, 90); 296 | P.AddArc(new Rectangle(Rectangle.Width - ArcRectangleWidth + Rectangle.X, Rectangle.Y, ArcRectangleWidth, ArcRectangleWidth), -90, 90); 297 | P.AddArc(new Rectangle(Rectangle.Width - ArcRectangleWidth + Rectangle.X, Rectangle.Height - ArcRectangleWidth + Rectangle.Y, ArcRectangleWidth, ArcRectangleWidth), 0, 90); 298 | P.AddArc(new Rectangle(Rectangle.X, Rectangle.Height - ArcRectangleWidth + Rectangle.Y, ArcRectangleWidth, ArcRectangleWidth), 90, 90); 299 | P.AddLine(new Point(Rectangle.X, Rectangle.Height - ArcRectangleWidth + Rectangle.Y), new Point(Rectangle.X, Curve + Rectangle.Y)); 300 | return P; 301 | } 302 | //Public Function RoundRect(ByVal X As Integer, ByVal Y As Integer, ByVal Width As Integer, ByVal Height As Integer, ByVal Curve As Integer) As GraphicsPath 303 | // Dim Rectangle As Rectangle = New Rectangle(X, Y, Width, Height) 304 | // Dim P As GraphicsPath = New GraphicsPath() 305 | // Dim ArcRectangleWidth As Integer = Curve * 2 306 | // P.AddArc(New Rectangle(Rectangle.X, Rectangle.Y, ArcRectangleWidth, ArcRectangleWidth), -180, 90) 307 | // P.AddArc(New Rectangle(Rectangle.Width - ArcRectangleWidth + Rectangle.X, Rectangle.Y, ArcRectangleWidth, ArcRectangleWidth), -90, 90) 308 | // P.AddArc(New Rectangle(Rectangle.Width - ArcRectangleWidth + Rectangle.X, Rectangle.Height - ArcRectangleWidth + Rectangle.Y, ArcRectangleWidth, ArcRectangleWidth), 0, 90) 309 | // P.AddArc(New Rectangle(Rectangle.X, Rectangle.Height - ArcRectangleWidth + Rectangle.Y, ArcRectangleWidth, ArcRectangleWidth), 90, 90) 310 | // P.AddLine(New Point(Rectangle.X, Rectangle.Height - ArcRectangleWidth + Rectangle.Y), New Point(Rectangle.X, Curve + Rectangle.Y)) 311 | // Return P 312 | //End Function 313 | } 314 | abstract class ThemeControl : Control 315 | { 316 | 317 | #region " Initialization " 318 | 319 | protected Graphics G; 320 | protected Bitmap B; 321 | public ThemeControl() 322 | { 323 | SetStyle((ControlStyles)139270, true); 324 | B = new Bitmap(1, 1); 325 | G = Graphics.FromImage(B); 326 | } 327 | 328 | public void AllowTransparent() 329 | { 330 | SetStyle(ControlStyles.Opaque, false); 331 | SetStyle(ControlStyles.SupportsTransparentBackColor, true); 332 | } 333 | 334 | public override string Text 335 | { 336 | get { return base.Text; } 337 | set 338 | { 339 | base.Text = value; 340 | Invalidate(); 341 | } 342 | } 343 | #endregion 344 | 345 | #region " Mouse Handling " 346 | 347 | protected enum State : byte 348 | { 349 | MouseNone = 0, 350 | MouseOver = 1, 351 | MouseDown = 2 352 | } 353 | 354 | protected State MouseState; 355 | protected override void OnMouseLeave(EventArgs e) 356 | { 357 | ChangeMouseState(State.MouseNone); 358 | base.OnMouseLeave(e); 359 | } 360 | protected override void OnMouseEnter(EventArgs e) 361 | { 362 | ChangeMouseState(State.MouseOver); 363 | base.OnMouseEnter(e); 364 | } 365 | protected override void OnMouseUp(MouseEventArgs e) 366 | { 367 | ChangeMouseState(State.MouseOver); 368 | base.OnMouseUp(e); 369 | } 370 | protected override void OnMouseDown(MouseEventArgs e) 371 | { 372 | if (e.Button == MouseButtons.Left) 373 | ChangeMouseState(State.MouseDown); 374 | base.OnMouseDown(e); 375 | } 376 | 377 | private void ChangeMouseState(State e) 378 | { 379 | MouseState = e; 380 | Invalidate(); 381 | } 382 | 383 | #endregion 384 | 385 | #region " Convienence " 386 | 387 | public abstract void PaintHook(); 388 | protected override sealed void OnPaint(PaintEventArgs e) 389 | { 390 | if (Width == 0 || Height == 0) 391 | return; 392 | PaintHook(); 393 | e.Graphics.DrawImage(B, 0, 0); 394 | } 395 | 396 | protected override void OnSizeChanged(EventArgs e) 397 | { 398 | if (!(Width == 0) && !(Height == 0)) 399 | { 400 | B = new Bitmap(Width, Height); 401 | G = Graphics.FromImage(B); 402 | Invalidate(); 403 | } 404 | base.OnSizeChanged(e); 405 | } 406 | 407 | private bool _NoRounding; 408 | public bool NoRounding 409 | { 410 | get { return _NoRounding; } 411 | set 412 | { 413 | _NoRounding = value; 414 | Invalidate(); 415 | } 416 | } 417 | 418 | private Image _Image; 419 | public Image Image 420 | { 421 | get { return _Image; } 422 | set 423 | { 424 | _Image = value; 425 | Invalidate(); 426 | } 427 | } 428 | public int ImageWidth 429 | { 430 | get 431 | { 432 | if (_Image == null) 433 | return 0; 434 | return _Image.Width; 435 | } 436 | } 437 | public int ImageTop 438 | { 439 | get 440 | { 441 | if (_Image == null) 442 | return 0; 443 | return Height / 2 - _Image.Height / 2; 444 | } 445 | } 446 | 447 | private Size _Size; 448 | private Rectangle _Rectangle; 449 | private LinearGradientBrush _Gradient; 450 | 451 | private SolidBrush _Brush; 452 | protected void DrawCorners(Color c, Rectangle rect) 453 | { 454 | if (_NoRounding) 455 | return; 456 | 457 | B.SetPixel(rect.X, rect.Y, c); 458 | B.SetPixel(rect.X + (rect.Width - 1), rect.Y, c); 459 | B.SetPixel(rect.X, rect.Y + (rect.Height - 1), c); 460 | B.SetPixel(rect.X + (rect.Width - 1), rect.Y + (rect.Height - 1), c); 461 | } 462 | 463 | protected void DrawBorders(Pen p1, Pen p2, Rectangle rect) 464 | { 465 | G.DrawRectangle(p1, rect.X, rect.Y, rect.Width - 1, rect.Height - 1); 466 | G.DrawRectangle(p2, rect.X + 1, rect.Y + 1, rect.Width - 3, rect.Height - 3); 467 | } 468 | 469 | protected void DrawText(HorizontalAlignment a, Color c, int x) 470 | { 471 | DrawText(a, c, x, 0); 472 | } 473 | protected void DrawText(HorizontalAlignment a, Color c, int x, int y) 474 | { 475 | if (string.IsNullOrEmpty(Text)) 476 | return; 477 | _Size = G.MeasureString(Text, Font).ToSize(); 478 | _Brush = new SolidBrush(c); 479 | 480 | switch (a) 481 | { 482 | case HorizontalAlignment.Left: 483 | G.DrawString(Text, Font, _Brush, x, Height / 2 - _Size.Height / 2 + y); 484 | break; 485 | case HorizontalAlignment.Right: 486 | G.DrawString(Text, Font, _Brush, Width - _Size.Width - x, Height / 2 - _Size.Height / 2 + y); 487 | break; 488 | case HorizontalAlignment.Center: 489 | G.DrawString(Text, Font, _Brush, Width / 2 - _Size.Width / 2 + x, Height / 2 - _Size.Height / 2 + y); 490 | break; 491 | } 492 | } 493 | 494 | protected void DrawIcon(HorizontalAlignment a, int x) 495 | { 496 | DrawIcon(a, x, 0); 497 | } 498 | protected void DrawIcon(HorizontalAlignment a, int x, int y) 499 | { 500 | if (_Image == null) 501 | return; 502 | switch (a) 503 | { 504 | case HorizontalAlignment.Left: 505 | G.DrawImage(_Image, x, Height / 2 - _Image.Height / 2 + y); 506 | break; 507 | case HorizontalAlignment.Right: 508 | G.DrawImage(_Image, Width - _Image.Width - x, Height / 2 - _Image.Height / 2 + y); 509 | break; 510 | case HorizontalAlignment.Center: 511 | G.DrawImage(_Image, Width / 2 - _Image.Width / 2, Height / 2 - _Image.Height / 2); 512 | break; 513 | } 514 | } 515 | 516 | protected void DrawGradient(Color c1, Color c2, int x, int y, int width, int height, float angle) 517 | { 518 | _Rectangle = new Rectangle(x, y, width, height); 519 | _Gradient = new LinearGradientBrush(_Rectangle, c1, c2, angle); 520 | G.FillRectangle(_Gradient, _Rectangle); 521 | } 522 | #endregion 523 | 524 | } 525 | abstract class ThemeContainerControl : ContainerControl 526 | { 527 | 528 | #region " Initialization " 529 | 530 | protected Graphics G; 531 | protected Bitmap B; 532 | public ThemeContainerControl() 533 | { 534 | SetStyle((ControlStyles)139270, true); 535 | B = new Bitmap(1, 1); 536 | G = Graphics.FromImage(B); 537 | } 538 | 539 | public void AllowTransparent() 540 | { 541 | SetStyle(ControlStyles.Opaque, false); 542 | SetStyle(ControlStyles.SupportsTransparentBackColor, true); 543 | } 544 | 545 | #endregion 546 | #region " Convienence " 547 | 548 | public abstract void PaintHook(); 549 | protected override sealed void OnPaint(PaintEventArgs e) 550 | { 551 | if (Width == 0 || Height == 0) 552 | return; 553 | PaintHook(); 554 | e.Graphics.DrawImage(B, 0, 0); 555 | } 556 | 557 | protected override void OnSizeChanged(EventArgs e) 558 | { 559 | if (!(Width == 0) && !(Height == 0)) 560 | { 561 | B = new Bitmap(Width, Height); 562 | G = Graphics.FromImage(B); 563 | Invalidate(); 564 | } 565 | base.OnSizeChanged(e); 566 | } 567 | 568 | private bool _NoRounding; 569 | public bool NoRounding 570 | { 571 | get { return _NoRounding; } 572 | set 573 | { 574 | _NoRounding = value; 575 | Invalidate(); 576 | } 577 | } 578 | 579 | private Rectangle _Rectangle; 580 | 581 | private LinearGradientBrush _Gradient; 582 | protected void DrawCorners(Color c, Rectangle rect) 583 | { 584 | if (_NoRounding) 585 | return; 586 | B.SetPixel(rect.X, rect.Y, c); 587 | B.SetPixel(rect.X + (rect.Width - 1), rect.Y, c); 588 | B.SetPixel(rect.X, rect.Y + (rect.Height - 1), c); 589 | B.SetPixel(rect.X + (rect.Width - 1), rect.Y + (rect.Height - 1), c); 590 | } 591 | 592 | protected void DrawBorders(Pen p1, Pen p2, Rectangle rect) 593 | { 594 | G.DrawRectangle(p1, rect.X, rect.Y, rect.Width - 1, rect.Height - 1); 595 | G.DrawRectangle(p2, rect.X + 1, rect.Y + 1, rect.Width - 3, rect.Height - 3); 596 | } 597 | 598 | protected void DrawGradient(Color c1, Color c2, int x, int y, int width, int height, float angle) 599 | { 600 | _Rectangle = new Rectangle(x, y, width, height); 601 | _Gradient = new LinearGradientBrush(_Rectangle, c1, c2, angle); 602 | G.FillRectangle(_Gradient, _Rectangle); 603 | } 604 | #endregion 605 | 606 | } 607 | 608 | class TxtBox : ThemeControl 609 | { 610 | #region "lol" 611 | TextBox txtbox = new TextBox(); 612 | private bool _passmask = false; 613 | public bool UseSystemPasswordChar 614 | { 615 | get { return _passmask; } 616 | set 617 | { 618 | txtbox.UseSystemPasswordChar = UseSystemPasswordChar; 619 | _passmask = value; 620 | Invalidate(); 621 | } 622 | } 623 | private int _maxchars = 32767; 624 | public int MaxLength 625 | { 626 | get { return _maxchars; } 627 | set 628 | { 629 | _maxchars = value; 630 | txtbox.MaxLength = MaxLength; 631 | Invalidate(); 632 | } 633 | } 634 | private HorizontalAlignment _align; 635 | public HorizontalAlignment TextAlignment 636 | { 637 | get { return _align; } 638 | set 639 | { 640 | _align = value; 641 | Invalidate(); 642 | } 643 | } 644 | 645 | protected override void OnPaintBackground(System.Windows.Forms.PaintEventArgs pevent) 646 | { 647 | } 648 | protected override void OnTextChanged(System.EventArgs e) 649 | { 650 | base.OnTextChanged(e); 651 | Invalidate(); 652 | } 653 | protected override void OnBackColorChanged(System.EventArgs e) 654 | { 655 | base.OnBackColorChanged(e); 656 | txtbox.BackColor = BackColor; 657 | Invalidate(); 658 | } 659 | protected override void OnForeColorChanged(System.EventArgs e) 660 | { 661 | base.OnForeColorChanged(e); 662 | txtbox.ForeColor = ForeColor; 663 | Invalidate(); 664 | } 665 | protected override void OnFontChanged(System.EventArgs e) 666 | { 667 | base.OnFontChanged(e); 668 | txtbox.Font = Font; 669 | } 670 | protected override void OnGotFocus(System.EventArgs e) 671 | { 672 | base.OnGotFocus(e); 673 | txtbox.Focus(); 674 | } 675 | public void // ERROR: Handles clauses are not supported in C# 676 | TextChngTxtBox() 677 | { 678 | Text = txtbox.Text; 679 | } 680 | public void // ERROR: Handles clauses are not supported in C# 681 | TextChng() 682 | { 683 | txtbox.Text = Text; 684 | } 685 | 686 | #endregion 687 | 688 | protected override void WndProc(ref Message m) 689 | { 690 | switch (m.Msg) 691 | { 692 | case 15: 693 | Invalidate(); 694 | base.WndProc(ref m); 695 | this.PaintHook(); 696 | break; // TODO: might not be correct. Was : Exit Select 697 | default: 698 | base.WndProc(ref m); 699 | break; // TODO: might not be correct. Was : Exit Select 700 | } 701 | } 702 | 703 | public TxtBox() 704 | : base() 705 | { 706 | 707 | Controls.Add(txtbox); 708 | { 709 | txtbox.Multiline = false; 710 | txtbox.BackColor = Color.FromArgb(0, 0, 0); 711 | txtbox.ForeColor = ForeColor; 712 | txtbox.Text = string.Empty; 713 | txtbox.TextAlign = HorizontalAlignment.Center; 714 | txtbox.BorderStyle = BorderStyle.None; 715 | txtbox.Location = new Point(5, 8); 716 | txtbox.Font = new Font("Arial", 8.25f, FontStyle.Bold); 717 | txtbox.Size = new Size(Width - 8, Height - 11); 718 | txtbox.UseSystemPasswordChar = UseSystemPasswordChar; 719 | } 720 | 721 | Text = ""; 722 | 723 | DoubleBuffered = true; 724 | } 725 | 726 | public override void PaintHook() 727 | { 728 | this.BackColor = Color.White; 729 | G.Clear(Parent.BackColor); 730 | Pen p = new Pen(Color.FromArgb(204, 204, 204), 1); 731 | Pen o = new Pen(Color.FromArgb(249, 249, 249), 8); 732 | G.FillPath(Brushes.White, Draw.RoundRect(new Rectangle(0, 0, Width - 1, Height - 1), 2)); 733 | G.DrawPath(o, Draw.RoundRect(new Rectangle(0, 0, Width - 1, Height - 1), 2)); 734 | G.DrawPath(p, Draw.RoundRect(new Rectangle(0, 0, Width - 1, Height - 1), 2)); 735 | Height = txtbox.Height + 16; 736 | Font drawFont = new Font("Tahoma", 9, FontStyle.Regular); 737 | { 738 | txtbox.Width = Width - 12; 739 | txtbox.ForeColor = Color.FromArgb(72, 72, 72); 740 | txtbox.Font = drawFont; 741 | txtbox.TextAlign = TextAlignment; 742 | txtbox.UseSystemPasswordChar = UseSystemPasswordChar; 743 | } 744 | DrawCorners(Parent.BackColor, ClientRectangle); 745 | } 746 | } 747 | 748 | class PanelBox : ThemeContainerControl 749 | { 750 | public PanelBox() 751 | { 752 | AllowTransparent(); 753 | } 754 | public override void PaintHook() 755 | { 756 | this.Font = new Font("Tahoma", 10); 757 | this.ForeColor = Color.FromArgb(40, 40, 40); 758 | G.SmoothingMode = SmoothingMode.AntiAlias; 759 | G.FillRectangle(new SolidBrush(Color.FromArgb(235, 235, 235)), new Rectangle(2, 0, Width, Height)); 760 | G.FillRectangle(new SolidBrush(Color.FromArgb(249, 249, 249)), new Rectangle(1, 0, Width - 3, Height - 4)); 761 | G.DrawRectangle(new Pen(Color.FromArgb(214, 214, 214)), 0, 0, Width - 2, Height - 3); 762 | } 763 | } 764 | class GroupDropBox : ThemeContainerControl 765 | { 766 | private bool _Checked; 767 | private int X; 768 | private int y; 769 | private Size _OpenedSize; 770 | public bool Checked 771 | { 772 | get { return _Checked; } 773 | set 774 | { 775 | _Checked = value; 776 | Invalidate(); 777 | } 778 | } 779 | public Size OpenSize 780 | { 781 | get { return _OpenedSize; } 782 | set 783 | { 784 | _OpenedSize = value; 785 | Invalidate(); 786 | } 787 | } 788 | public GroupDropBox() 789 | { 790 | 791 | AllowTransparent(); 792 | Size = new Size(90, 30); 793 | MinimumSize = new Size(5, 30); 794 | _Checked = true; 795 | this.Resize += new EventHandler(GroupDropBox_Resize); 796 | this.MouseDown += new MouseEventHandler(GroupDropBox_MouseDown); 797 | } 798 | public override void PaintHook() 799 | { 800 | this.Font = new Font("Tahoma", 10); 801 | this.ForeColor = Color.FromArgb(40, 40, 40); 802 | if (_Checked == true) 803 | { 804 | G.SmoothingMode = SmoothingMode.AntiAlias; 805 | G.Clear(Color.FromArgb(245, 245, 245)); 806 | G.FillRectangle(new SolidBrush(Color.FromArgb(231, 231, 231)), new Rectangle(0, 0, Width, 30)); 807 | G.DrawLine(new Pen(Color.FromArgb(233, 238, 240)), 1, 1, Width - 2, 1); 808 | G.DrawRectangle(new Pen(Color.FromArgb(214, 214, 214)), 0, 0, Width - 1, Height - 1); 809 | G.DrawRectangle(new Pen(Color.FromArgb(214, 214, 214)), 0, 0, Width - 1, 30); 810 | this.Size = _OpenedSize; 811 | G.DrawString("t", new Font("Marlett", 12), new SolidBrush(this.ForeColor), Width - 25, 5); 812 | } 813 | else 814 | { 815 | G.SmoothingMode = SmoothingMode.AntiAlias; 816 | G.Clear(Color.FromArgb(245, 245, 245)); 817 | G.FillRectangle(new SolidBrush(Color.FromArgb(231, 231, 231)), new Rectangle(0, 0, Width, 30)); 818 | G.DrawLine(new Pen(Color.FromArgb(231, 236, 238)), 1, 1, Width - 2, 1); 819 | G.DrawRectangle(new Pen(Color.FromArgb(214, 214, 214)), 0, 0, Width - 1, Height - 1); 820 | G.DrawRectangle(new Pen(Color.FromArgb(214, 214, 214)), 0, 0, Width - 1, 30); 821 | this.Size = new Size(Width, 30); 822 | G.DrawString("u", new Font("Marlett", 12), new SolidBrush(this.ForeColor), Width - 25, 5); 823 | } 824 | G.DrawString(Text, Font, new SolidBrush(this.ForeColor), 7, 6); 825 | } 826 | 827 | private void GroupDropBox_Resize(object sender, System.EventArgs e) 828 | { 829 | if (_Checked == true) 830 | { 831 | _OpenedSize = this.Size; 832 | } 833 | } 834 | 835 | 836 | protected override void OnMouseMove(System.Windows.Forms.MouseEventArgs e) 837 | { 838 | base.OnMouseMove(e); 839 | X = e.X; 840 | y = e.Y; 841 | Invalidate(); 842 | } 843 | 844 | 845 | private void GroupDropBox_MouseDown(object sender, MouseEventArgs e) 846 | { 847 | 848 | if (X >= Width - 22) 849 | { 850 | if (y <= 30) 851 | { 852 | switch (Checked) 853 | { 854 | case true: 855 | Checked = false; 856 | break; 857 | case false: 858 | Checked = true; 859 | break; 860 | } 861 | } 862 | } 863 | } 864 | } 865 | class GroupPanelBox : ThemeContainerControl 866 | { 867 | public GroupPanelBox() 868 | { 869 | AllowTransparent(); 870 | } 871 | public override void PaintHook() 872 | { 873 | this.Font = new Font("Tahoma", 10); 874 | this.ForeColor = Color.FromArgb(40, 40, 40); 875 | G.SmoothingMode = SmoothingMode.AntiAlias; 876 | G.Clear(Color.FromArgb(245, 245, 245)); 877 | G.FillRectangle(new SolidBrush(Color.FromArgb(231, 231, 231)), new Rectangle(0, 0, Width, 30)); 878 | G.DrawLine(new Pen(Color.FromArgb(233, 238, 240)), 1, 1, Width - 2, 1); 879 | G.DrawRectangle(new Pen(Color.FromArgb(214, 214, 214)), 0, 0, Width - 1, Height - 1); 880 | G.DrawRectangle(new Pen(Color.FromArgb(214, 214, 214)), 0, 0, Width - 1, 30); 881 | G.DrawString(Text, Font, new SolidBrush(this.ForeColor), 7, 6); 882 | } 883 | } 884 | 885 | class ButtonGreen : ThemeControl 886 | { 887 | public override void PaintHook() 888 | { 889 | this.Font = new Font("Arial", 10); 890 | G.Clear(this.BackColor); 891 | G.SmoothingMode = SmoothingMode.HighQuality; 892 | switch (MouseState) 893 | { 894 | case State.MouseNone: 895 | Pen p1 = new Pen(Color.FromArgb(120, 159, 22), 1); 896 | LinearGradientBrush x1 = new LinearGradientBrush(ClientRectangle, Color.FromArgb(157, 209, 57), Color.FromArgb(130, 181, 18), LinearGradientMode.Vertical); 897 | G.FillPath(x1, Draw.RoundRect(ClientRectangle, 4)); 898 | G.DrawPath(p1, Draw.RoundRect(new Rectangle(0, 0, Width - 1, Height - 1), 3)); 899 | G.DrawLine(new Pen(Color.FromArgb(190, 232, 109)), 2, 1, Width - 3, 1); 900 | DrawText(HorizontalAlignment.Center, Color.FromArgb(240, 240, 240), 0); 901 | break; 902 | case State.MouseDown: 903 | Pen p2 = new Pen(Color.FromArgb(120, 159, 22), 1); 904 | LinearGradientBrush x2 = new LinearGradientBrush(ClientRectangle, Color.FromArgb(125, 171, 25), Color.FromArgb(142, 192, 40), LinearGradientMode.Vertical); 905 | G.FillPath(x2, Draw.RoundRect(ClientRectangle, 4)); 906 | G.DrawPath(p2, Draw.RoundRect(new Rectangle(0, 0, Width - 1, Height - 1), 3)); 907 | G.DrawLine(new Pen(Color.FromArgb(142, 172, 30)), 2, 1, Width - 3, 1); 908 | DrawText(HorizontalAlignment.Center, Color.FromArgb(250, 250, 250), 1); 909 | break; 910 | case State.MouseOver: 911 | Pen p3 = new Pen(Color.FromArgb(120, 159, 22), 1); 912 | LinearGradientBrush x3 = new LinearGradientBrush(ClientRectangle, Color.FromArgb(165, 220, 59), Color.FromArgb(137, 191, 18), LinearGradientMode.Vertical); 913 | G.FillPath(x3, Draw.RoundRect(ClientRectangle, 4)); 914 | G.DrawPath(p3, Draw.RoundRect(new Rectangle(0, 0, Width - 1, Height - 1), 3)); 915 | G.DrawLine(new Pen(Color.FromArgb(190, 232, 109)), 2, 1, Width - 3, 1); 916 | DrawText(HorizontalAlignment.Center, Color.FromArgb(240, 240, 240), -1); 917 | break; 918 | } 919 | this.Cursor = Cursors.Hand; 920 | } 921 | } 922 | class ButtonBlue : ThemeControl 923 | { 924 | public override void PaintHook() 925 | { 926 | this.Font = new Font("Arial", 10); 927 | G.Clear(this.BackColor); 928 | G.SmoothingMode = SmoothingMode.HighQuality; 929 | switch (MouseState) 930 | { 931 | case State.MouseNone: 932 | Pen p = new Pen(Color.FromArgb(34, 112, 171), 1); 933 | LinearGradientBrush x = new LinearGradientBrush(ClientRectangle, Color.FromArgb(51, 159, 231), Color.FromArgb(33, 128, 206), LinearGradientMode.Vertical); 934 | G.FillPath(x, Draw.RoundRect(ClientRectangle, 4)); 935 | G.DrawPath(p, Draw.RoundRect(new Rectangle(0, 0, Width - 1, Height - 1), 3)); 936 | G.DrawLine(new Pen(Color.FromArgb(131, 197, 241)), 2, 1, Width - 3, 1); 937 | DrawText(HorizontalAlignment.Center, Color.FromArgb(240, 240, 240), 0); 938 | break; 939 | case State.MouseDown: 940 | Pen p1 = new Pen(Color.FromArgb(34, 112, 171), 1); 941 | LinearGradientBrush x1 = new LinearGradientBrush(ClientRectangle, Color.FromArgb(37, 124, 196), Color.FromArgb(53, 153, 219), LinearGradientMode.Vertical); 942 | G.FillPath(x1, Draw.RoundRect(ClientRectangle, 4)); 943 | G.DrawPath(p1, Draw.RoundRect(new Rectangle(0, 0, Width - 1, Height - 1), 3)); 944 | 945 | DrawText(HorizontalAlignment.Center, Color.FromArgb(250, 250, 250), 1); 946 | break; 947 | case State.MouseOver: 948 | Pen p2 = new Pen(Color.FromArgb(34, 112, 171), 1); 949 | LinearGradientBrush x2 = new LinearGradientBrush(ClientRectangle, Color.FromArgb(54, 167, 243), Color.FromArgb(35, 165, 217), LinearGradientMode.Vertical); 950 | G.FillPath(x2, Draw.RoundRect(ClientRectangle, 4)); 951 | G.DrawPath(p2, Draw.RoundRect(new Rectangle(0, 0, Width - 1, Height - 1), 3)); 952 | G.DrawLine(new Pen(Color.FromArgb(131, 197, 241)), 2, 1, Width - 3, 1); 953 | DrawText(HorizontalAlignment.Center, Color.FromArgb(240, 240, 240), -1); 954 | break; 955 | } 956 | this.Cursor = Cursors.Hand; 957 | } 958 | } -------------------------------------------------------------------------------- /Windows Forms Themes/darksky_c#_theme.cs: -------------------------------------------------------------------------------- 1 | // theme base 1.5.2 2 | using System; 3 | using System.Windows.Forms; 4 | using System.Drawing; 5 | using System.Drawing.Drawing2D; 6 | using System.Windows.Forms; 7 | 8 | public class TransparentLabel : Label 9 | { 10 | public TransparentLabel() 11 | { 12 | base.SetStyle(ControlStyles.Opaque, true); 13 | base.SetStyle(ControlStyles.OptimizedDoubleBuffer, false); 14 | this.ForeColor = Color.FromArgb(0x71, 170, 0xba); 15 | } 16 | 17 | protected override System.Windows.Forms.CreateParams CreateParams 18 | { 19 | get 20 | { 21 | System.Windows.Forms.CreateParams createParams = base.CreateParams; 22 | createParams.ExStyle |= 0x20; 23 | return createParams; 24 | } 25 | } 26 | } 27 | 28 | public class SkyDarkTop : Control 29 | { 30 | private Color C1 = Color.FromArgb(0x5e, 0x67, 0x6a); 31 | private Color C2 = Color.FromArgb(0x98, 0xb6, 0xc0); 32 | private Color C3 = Color.FromArgb(0x47, 70, 0x45); 33 | private Color C4 = Color.FromArgb(0x3a, 0x38, 0x36); 34 | private Color CD = Color.FromArgb(0x56, 0x5e, 0x60); 35 | private MouseState ms; 36 | 37 | public SkyDarkTop() 38 | { 39 | this.DoubleBuffered = true; 40 | base.Size = new Size(10, 10); 41 | } 42 | 43 | protected override void OnMouseDown(MouseEventArgs e) 44 | { 45 | base.OnMouseDown(e); 46 | this.State = MouseState.Down; 47 | } 48 | 49 | protected override void OnMouseEnter(EventArgs e) 50 | { 51 | base.OnMouseEnter(e); 52 | this.State = MouseState.Over; 53 | } 54 | 55 | protected override void OnMouseLeave(EventArgs e) 56 | { 57 | base.OnMouseLeave(e); 58 | this.State = MouseState.None; 59 | } 60 | 61 | protected override void OnMouseUp(MouseEventArgs e) 62 | { 63 | base.OnMouseUp(e); 64 | this.State = MouseState.Over; 65 | } 66 | 67 | protected override void OnPaint(PaintEventArgs e) 68 | { 69 | Bitmap image = new Bitmap(base.Width, base.Height); 70 | Graphics graphics = Graphics.FromImage(image); 71 | LinearGradientBrush brush = new LinearGradientBrush(new Point(0, 0), new Point(0, base.Height), this.C3, this.C4); 72 | graphics.FillRectangle(brush, base.ClientRectangle); 73 | brush.Dispose(); 74 | graphics.SmoothingMode = SmoothingMode.HighQuality; 75 | switch (this.State) 76 | { 77 | case MouseState.None: 78 | graphics.DrawEllipse(new Pen(this.C1, 2f), new Rectangle(2, 2, base.Width - 5, base.Height - 5)); 79 | break; 80 | 81 | case MouseState.Over: 82 | graphics.DrawEllipse(new Pen(this.C2, 2f), new Rectangle(2, 2, base.Width - 5, base.Height - 5)); 83 | break; 84 | 85 | case MouseState.Down: 86 | graphics.DrawEllipse(new Pen(this.CD, 2f), new Rectangle(2, 2, base.Width - 5, base.Height - 5)); 87 | break; 88 | } 89 | graphics.FillEllipse(ConversionFunctions.ToBrush(this.C2), new Rectangle(5, 5, base.Width - 11, base.Height - 11)); 90 | e.Graphics.DrawImage(image, 0, 0); 91 | graphics.Dispose(); 92 | image.Dispose(); 93 | } 94 | 95 | private MouseState State 96 | { 97 | get 98 | { 99 | return this.ms; 100 | } 101 | set 102 | { 103 | this.ms = value; 104 | base.Invalidate(); 105 | } 106 | } 107 | 108 | public enum MouseState 109 | { 110 | None, 111 | Over, 112 | Down 113 | } 114 | } 115 | 116 | public class SkyDarkTabControl : TabControl 117 | { 118 | private Color C1 = Color.FromArgb(0x3e, 60, 0x3a); 119 | private Color C2 = Color.FromArgb(80, 0x4e, 0x4c); 120 | private Color C3 = Color.FromArgb(0x33, 0x31, 0x2f); 121 | 122 | public SkyDarkTabControl() 123 | { 124 | base.SetStyle(ControlStyles.DoubleBuffer | ControlStyles.AllPaintingInWmPaint | ControlStyles.ResizeRedraw | ControlStyles.UserPaint, true); 125 | this.DoubleBuffered = true; 126 | } 127 | 128 | protected override void CreateHandle() 129 | { 130 | base.CreateHandle(); 131 | base.Alignment = TabAlignment.Top; 132 | } 133 | 134 | protected override void OnPaint(PaintEventArgs e) 135 | { 136 | Bitmap image = new Bitmap(base.Width, base.Height); 137 | Graphics graphics = Graphics.FromImage(image); 138 | try 139 | { 140 | base.SelectedTab.BackColor = this.C1; 141 | } 142 | catch 143 | { 144 | } 145 | graphics.Clear(base.Parent.BackColor); 146 | for (int i = 0; i <= (base.TabCount - 1); i++) 147 | { 148 | if (i == base.SelectedIndex) 149 | { 150 | continue; 151 | } 152 | Rectangle rect = new Rectangle(base.GetTabRect(i).X, base.GetTabRect(i).Y + 3, base.GetTabRect(i).Width + 2, base.GetTabRect(i).Height); 153 | LinearGradientBrush brush = new LinearGradientBrush(new Point(rect.X, rect.Y), new Point(rect.X, rect.Y + rect.Height), Color.FromArgb(60, 0x3b, 0x3a), Color.FromArgb(0x45, 0x45, 70)); 154 | graphics.FillRectangle(brush, rect); 155 | brush.Dispose(); 156 | graphics.DrawRectangle(ConversionFunctions.ToPen(this.C3), rect); 157 | graphics.DrawRectangle(ConversionFunctions.ToPen(this.C2), new Rectangle(rect.X + 1, rect.Y + 1, rect.Width - 2, rect.Height)); 158 | string s = string.Empty; 159 | switch (i) 160 | { 161 | case 0: 162 | s = "Main"; 163 | break; 164 | 165 | case 1: 166 | s = "Extra"; 167 | break; 168 | 169 | case 2: 170 | s = "Scan"; 171 | break; 172 | 173 | case 3: 174 | s = "Info"; 175 | break; 176 | } 177 | StringFormat format = new StringFormat { 178 | LineAlignment = StringAlignment.Center, 179 | Alignment = StringAlignment.Center 180 | }; 181 | graphics.DrawString(s, this.Font, ConversionFunctions.ToBrush(130, 0xb0, 190), rect, format); 182 | } 183 | graphics.FillRectangle(ConversionFunctions.ToBrush(this.C1), 0, base.ItemSize.Height, base.Width, base.Height); 184 | graphics.DrawRectangle(ConversionFunctions.ToPen(this.C2), 0, base.ItemSize.Height, base.Width - 1, (base.Height - base.ItemSize.Height) - 1); 185 | graphics.DrawRectangle(ConversionFunctions.ToPen(this.C3), 1, base.ItemSize.Height + 1, base.Width - 3, (base.Height - base.ItemSize.Height) - 3); 186 | if (base.SelectedIndex != -1) 187 | { 188 | string str2 = string.Empty; 189 | if (base.SelectedIndex == 0) 190 | { 191 | str2 = "Main"; 192 | } 193 | else if (base.SelectedIndex == 1) 194 | { 195 | str2 = "Extra"; 196 | } 197 | else if (base.SelectedIndex == 2) 198 | { 199 | str2 = "Scan"; 200 | } 201 | else if (base.SelectedIndex == 3) 202 | { 203 | str2 = "Info"; 204 | } 205 | Rectangle layoutRectangle = new Rectangle(base.GetTabRect(base.SelectedIndex).X - 2, base.GetTabRect(base.SelectedIndex).Y, base.GetTabRect(base.SelectedIndex).Width + 3, base.GetTabRect(base.SelectedIndex).Height); 206 | graphics.FillRectangle(ConversionFunctions.ToBrush(this.C1), new Rectangle(layoutRectangle.X + 2, layoutRectangle.Y + 2, layoutRectangle.Width - 2, layoutRectangle.Height)); 207 | graphics.DrawLine(ConversionFunctions.ToPen(this.C2), new Point(layoutRectangle.X, (layoutRectangle.Y + layoutRectangle.Height) - 2), new Point(layoutRectangle.X, layoutRectangle.Y)); 208 | graphics.DrawLine(ConversionFunctions.ToPen(this.C2), new Point(layoutRectangle.X, layoutRectangle.Y), new Point(layoutRectangle.X + layoutRectangle.Width, layoutRectangle.Y)); 209 | graphics.DrawLine(ConversionFunctions.ToPen(this.C2), new Point(layoutRectangle.X + layoutRectangle.Width, layoutRectangle.Y), new Point(layoutRectangle.X + layoutRectangle.Width, (layoutRectangle.Y + layoutRectangle.Height) - 2)); 210 | graphics.DrawLine(ConversionFunctions.ToPen(this.C3), new Point(layoutRectangle.X + 1, (layoutRectangle.Y + layoutRectangle.Height) - 1), new Point(layoutRectangle.X + 1, layoutRectangle.Y + 1)); 211 | graphics.DrawLine(ConversionFunctions.ToPen(this.C3), new Point(layoutRectangle.X + 1, layoutRectangle.Y + 1), new Point((layoutRectangle.X + layoutRectangle.Width) - 1, layoutRectangle.Y + 1)); 212 | graphics.DrawLine(ConversionFunctions.ToPen(this.C3), new Point((layoutRectangle.X + layoutRectangle.Width) - 1, layoutRectangle.Y + 1), new Point((layoutRectangle.X + layoutRectangle.Width) - 1, (layoutRectangle.Y + layoutRectangle.Height) - 1)); 213 | StringFormat format2 = new StringFormat { 214 | LineAlignment = StringAlignment.Center, 215 | Alignment = StringAlignment.Center 216 | }; 217 | graphics.DrawString(str2, this.Font, ConversionFunctions.ToBrush(130, 0xb0, 190), layoutRectangle, format2); 218 | } 219 | e.Graphics.DrawImage(image, 0, 0); 220 | graphics.Dispose(); 221 | image.Dispose(); 222 | } 223 | } 224 | 225 | public class SkyDarkSeperator : Control 226 | { 227 | private Alignment al; 228 | private Color C1 = Color.FromArgb(0x33, 0x31, 0x2f); 229 | private Color C2 = Color.FromArgb(90, 0x5b, 90); 230 | 231 | protected override void OnPaint(PaintEventArgs e) 232 | { 233 | Bitmap image = new Bitmap(base.Width, base.Height); 234 | Graphics graphics = Graphics.FromImage(image); 235 | switch (this.Align) 236 | { 237 | case Alignment.Vertical: 238 | graphics.DrawLine(ConversionFunctions.ToPen(this.C1), new Point(base.Width / 2, 0), new Point(base.Width / 2, base.Height)); 239 | graphics.DrawLine(ConversionFunctions.ToPen(this.C2), new Point((base.Width / 2) + 1, 0), new Point((base.Width / 2) + 1, base.Height)); 240 | break; 241 | 242 | case Alignment.Horizontal: 243 | graphics.DrawLine(ConversionFunctions.ToPen(this.C1), new Point(0, base.Height / 2), new Point(base.Width, base.Height / 2)); 244 | graphics.DrawLine(ConversionFunctions.ToPen(this.C2), new Point(0, (base.Height / 2) + 1), new Point(base.Width, (base.Height / 2) + 1)); 245 | break; 246 | } 247 | e.Graphics.DrawImage(image, 0, 0); 248 | graphics.Dispose(); 249 | image.Dispose(); 250 | } 251 | 252 | public Alignment Align 253 | { 254 | get 255 | { 256 | return this.al; 257 | } 258 | set 259 | { 260 | this.al = value; 261 | base.Invalidate(); 262 | } 263 | } 264 | 265 | public enum Alignment 266 | { 267 | Vertical, 268 | Horizontal 269 | } 270 | } 271 | 272 | public class SkyDarkRadio : Control 273 | { 274 | private Color C1 = Color.FromArgb(0x23, 0x23, 0x23); 275 | private Color C2 = Color.Transparent; 276 | private Color C3 = Color.Transparent; 277 | private Color C4 = Color.Transparent; 278 | private bool chk; 279 | private MouseState ms; 280 | 281 | public SkyDarkRadio() 282 | { 283 | base.Size = new Size(base.Width, 13); 284 | } 285 | 286 | protected override void OnMouseDown(MouseEventArgs e) 287 | { 288 | if (!base.Enabled) 289 | { 290 | this.State = MouseState.Down; 291 | } 292 | } 293 | 294 | protected override void OnMouseUp(MouseEventArgs e) 295 | { 296 | if (base.Enabled) 297 | { 298 | this.State = MouseState.None; 299 | if (!this.Checked) 300 | { 301 | this.Checked = true; 302 | } 303 | } 304 | } 305 | 306 | protected override void OnPaint(PaintEventArgs e) 307 | { 308 | Bitmap image = new Bitmap(base.Width, base.Height); 309 | Graphics graphics = Graphics.FromImage(image); 310 | graphics.Clear(base.Parent.BackColor); 311 | switch (base.Enabled) 312 | { 313 | case false: 314 | this.C2 = Color.FromArgb(70, 70, 70); 315 | this.C3 = Color.FromArgb(0x36, 0x36, 0x33); 316 | this.C4 = Color.FromArgb(0x59, 0x58, 0x58); 317 | break; 318 | 319 | case true: 320 | switch (this.State) 321 | { 322 | case MouseState.None: 323 | this.C2 = Color.FromArgb(70, 70, 70); 324 | this.C3 = Color.FromArgb(0x36, 0x36, 0x33); 325 | this.C4 = Color.FromArgb(0x98, 0xb6, 0xc0); 326 | break; 327 | 328 | case MouseState.Down: 329 | this.C2 = Color.FromArgb(0x36, 0x36, 0x33); 330 | this.C3 = Color.FromArgb(70, 70, 70); 331 | this.C4 = Color.FromArgb(0x70, 0x8e, 0x98); 332 | break; 333 | } 334 | break; 335 | } 336 | Rectangle rect = new Rectangle(0, 0, base.Height - 1, base.Height - 1); 337 | LinearGradientBrush brush = new LinearGradientBrush(new Point(rect.X + (rect.Width / 2), rect.Y), new Point(rect.X + (rect.Width / 2), rect.Y + rect.Height), this.C2, this.C3); 338 | graphics.SmoothingMode = SmoothingMode.HighQuality; 339 | graphics.FillEllipse(brush, rect); 340 | graphics.DrawEllipse(new Pen(ConversionFunctions.ToBrush(this.C1)), rect); 341 | if (this.Checked) 342 | { 343 | graphics.FillEllipse(ConversionFunctions.ToBrush(this.C4), new Rectangle(rect.X + (rect.Width / 4), rect.Y + (rect.Height / 4), rect.Width / 2, rect.Height / 2)); 344 | } 345 | StringFormat format = new StringFormat { 346 | LineAlignment = StringAlignment.Center, 347 | Alignment = StringAlignment.Near 348 | }; 349 | graphics.DrawString(base.Text, this.Font, ConversionFunctions.ToBrush(this.C4), new Rectangle((rect.X + rect.Width) + 5, 0, ((base.Width - rect.X) - rect.Width) - 5, base.Height), format); 350 | e.Graphics.DrawImage(image, 0, 0); 351 | graphics.Dispose(); 352 | image.Dispose(); 353 | } 354 | 355 | public bool Checked 356 | { 357 | get 358 | { 359 | return this.chk; 360 | } 361 | set 362 | { 363 | this.chk = value; 364 | base.Invalidate(); 365 | try 366 | { 367 | if (value) 368 | { 369 | foreach (object obj2 in base.Parent.Controls) 370 | { 371 | if ((obj2 is SkyDarkRadio) && (!object.ReferenceEquals(obj2, this) & ((SkyDarkRadio) obj2).Enabled)) 372 | { 373 | ((SkyDarkRadio) obj2).Checked = false; 374 | } 375 | } 376 | } 377 | } 378 | catch 379 | { 380 | } 381 | } 382 | } 383 | 384 | public MouseState State 385 | { 386 | get 387 | { 388 | return this.ms; 389 | } 390 | set 391 | { 392 | this.ms = value; 393 | base.Invalidate(); 394 | } 395 | } 396 | 397 | public enum MouseState 398 | { 399 | None, 400 | Down 401 | } 402 | } 403 | public class SkyDarkProgress : Control 404 | { 405 | private Color C1 = Color.FromArgb(0x33, 0x31, 0x2f); 406 | private Color C2 = Color.FromArgb(0x51, 0x4d, 0x4d); 407 | private Color C3 = Color.FromArgb(0x40, 60, 0x3b); 408 | private Color C4 = Color.FromArgb(70, 0x47, 70); 409 | private Color C5 = Color.FromArgb(0x3e, 0x3b, 0x3a); 410 | private int max = 100; 411 | private int val; 412 | 413 | protected override void OnPaint(PaintEventArgs e) 414 | { 415 | Bitmap image = new Bitmap(base.Width, base.Height); 416 | Graphics graphics = Graphics.FromImage(image); 417 | Rectangle rect = new Rectangle(3, 3, Convert.ToInt32((int) ((base.Width - 7) * this.val / this.max)), base.Height - 7); 418 | graphics.Clear(this.C5); 419 | LinearGradientBrush brush = new LinearGradientBrush(new Point(0, 0), new Point(0, base.Height), this.C3, this.C4); 420 | graphics.FillRectangle(brush, rect); 421 | brush.Dispose(); 422 | graphics.DrawRectangle(ConversionFunctions.ToPen(this.C2), rect); 423 | graphics.DrawRectangle(ConversionFunctions.ToPen(this.C1), 0, 0, base.Width - 1, base.Height - 1); 424 | graphics.DrawRectangle(ConversionFunctions.ToPen(this.C2), 1, 1, base.Width - 3, base.Height - 3); 425 | e.Graphics.DrawImage(image, 0, 0); 426 | graphics.Dispose(); 427 | image.Dispose(); 428 | } 429 | 430 | public int Maximum 431 | { 432 | get 433 | { 434 | return this.max; 435 | } 436 | set 437 | { 438 | if (value < 1) 439 | { 440 | this.max = 1; 441 | } 442 | else 443 | { 444 | this.max = value; 445 | } 446 | if (value < this.val) 447 | { 448 | this.val = this.max; 449 | } 450 | base.Invalidate(); 451 | } 452 | } 453 | 454 | public int Value 455 | { 456 | get 457 | { 458 | return this.val; 459 | } 460 | set 461 | { 462 | if (value > this.max) 463 | { 464 | this.val = this.max; 465 | } 466 | else if (value < 0) 467 | { 468 | this.val = 0; 469 | } 470 | else 471 | { 472 | this.val = value; 473 | } 474 | base.Invalidate(); 475 | } 476 | } 477 | } 478 | 479 | public class SkyDarkForm2 : ContainerControl 480 | { 481 | private Color C1 = Color.FromArgb(0x3e, 60, 0x3a); 482 | private Color C2 = Color.FromArgb(0x51, 0x4f, 0x4d); 483 | private Color C3 = Color.FromArgb(0x47, 70, 0x45); 484 | private Color C4 = Color.FromArgb(0x3a, 0x38, 0x36); 485 | private bool Locked; 486 | private Point Locked1; 487 | private Rectangle T1; 488 | private SkyDarkTop withEventsField_Maxim; 489 | 490 | public SkyDarkForm2() 491 | { 492 | this.Dock = DockStyle.Fill; 493 | base.SendToBack(); 494 | this.BackColor = Color.FromArgb(0x3e, 60, 0x3a); 495 | } 496 | 497 | private void Maxim_Click(object sender, EventArgs e) 498 | { 499 | base.ParentForm.WindowState = FormWindowState.Minimized; 500 | } 501 | 502 | protected override void OnHandleCreated(EventArgs e) 503 | { 504 | base.ParentForm.FormBorderStyle = FormBorderStyle.None; 505 | SkyDarkTop top = new SkyDarkTop { 506 | Location = new Point(base.Width - 0x16, 3), 507 | Size = new Size(0, 0), 508 | Parent = this 509 | }; 510 | this.Maxim = top; 511 | base.Controls.Add(this.Maxim); 512 | this.Maxim.Show(); 513 | } 514 | 515 | protected override void OnPaint(PaintEventArgs e) 516 | { 517 | this.T1 = new Rectangle(1, 1, base.Width - 3, 0x12); 518 | Bitmap image = new Bitmap(base.Width, base.Height); 519 | Graphics graphics = Graphics.FromImage(image); 520 | graphics.Clear(this.C1); 521 | LinearGradientBrush brush = new LinearGradientBrush(new Point(this.T1.X, this.T1.Y), new Point(this.T1.X, this.T1.Y + this.T1.Height), this.C3, this.C4); 522 | graphics.FillRectangle(brush, this.T1); 523 | graphics.DrawRectangle(ConversionFunctions.ToPen(this.C2), this.T1); 524 | graphics.DrawRectangle(ConversionFunctions.ToPen(this.C2), new Rectangle(this.T1.X, (this.T1.Y + this.T1.Height) + 2, this.T1.Width, ((base.Height - this.T1.Y) - this.T1.Height) - 4)); 525 | brush.Dispose(); 526 | StringFormat format = new StringFormat { 527 | LineAlignment = StringAlignment.Center 528 | }; 529 | graphics.DrawString(base.Text, this.Font, ConversionFunctions.ToBrush(0x71, 170, 0xba), new Rectangle(new Point(this.T1.X + 4, this.T1.Y), new Size(this.T1.Width - 40, this.T1.Height)), format); 530 | e.Graphics.DrawImage(image, 0, 0); 531 | graphics.Dispose(); 532 | image.Dispose(); 533 | } 534 | 535 | protected override void OnResize(EventArgs e) 536 | { 537 | base.OnResize(e); 538 | this.T1 = new Rectangle(1, 1, base.Width - 3, 0x12); 539 | } 540 | 541 | public SkyDarkTop Maxim 542 | { 543 | get 544 | { 545 | return this.withEventsField_Maxim; 546 | } 547 | set 548 | { 549 | if (this.withEventsField_Maxim != null) 550 | { 551 | this.withEventsField_Maxim.Click -= new EventHandler(this.Maxim_Click); 552 | } 553 | this.withEventsField_Maxim = value; 554 | if (this.withEventsField_Maxim != null) 555 | { 556 | this.withEventsField_Maxim.Click += new EventHandler(this.Maxim_Click); 557 | } 558 | } 559 | } 560 | } 561 | 562 | public class SkyDarkForm : ContainerControl 563 | { 564 | private Color C1 = Color.FromArgb(0x3e, 60, 0x3a); 565 | private Color C2 = Color.FromArgb(0x51, 0x4f, 0x4d); 566 | private Color C3 = Color.FromArgb(0x47, 70, 0x45); 567 | private Color C4 = Color.FromArgb(0x3a, 0x38, 0x36); 568 | private bool Locked; 569 | private Point Locked1; 570 | private Rectangle T1; 571 | private SkyDarkTop withEventsField_Exim; 572 | private SkyDarkTop withEventsField_Maxim; 573 | 574 | public SkyDarkForm() 575 | { 576 | this.Dock = DockStyle.Fill; 577 | base.SendToBack(); 578 | this.BackColor = Color.FromArgb(0x3e, 60, 0x3a); 579 | } 580 | 581 | private void Exim_Click(object sender, EventArgs e) 582 | { 583 | Application.Exit(); 584 | } 585 | 586 | private void Maxim_Click(object sender, EventArgs e) 587 | { 588 | base.ParentForm.WindowState = FormWindowState.Minimized; 589 | } 590 | 591 | protected override void OnHandleCreated(EventArgs e) 592 | { 593 | base.ParentForm.FormBorderStyle = FormBorderStyle.None; 594 | SkyDarkTop top = new SkyDarkTop { 595 | Location = new Point(base.Width - 0x29, 3), 596 | Size = new Size(14, 14), 597 | Parent = this 598 | }; 599 | this.Maxim = top; 600 | SkyDarkTop top2 = new SkyDarkTop { 601 | Location = new Point(base.Width - 0x16, 3), 602 | Size = new Size(14, 14), 603 | Parent = this 604 | }; 605 | this.Exim = top2; 606 | base.Controls.Add(this.Maxim); 607 | base.Controls.Add(this.Exim); 608 | this.Maxim.Show(); 609 | this.Exim.Show(); 610 | } 611 | 612 | protected override void OnPaint(PaintEventArgs e) 613 | { 614 | this.T1 = new Rectangle(1, 1, base.Width - 3, 0x12); 615 | Bitmap image = new Bitmap(base.Width, base.Height); 616 | Graphics graphics = Graphics.FromImage(image); 617 | graphics.Clear(this.C1); 618 | LinearGradientBrush brush = new LinearGradientBrush(new Point(this.T1.X, this.T1.Y), new Point(this.T1.X, this.T1.Y + this.T1.Height), this.C3, this.C4); 619 | graphics.FillRectangle(brush, this.T1); 620 | graphics.DrawRectangle(ConversionFunctions.ToPen(this.C2), this.T1); 621 | graphics.DrawRectangle(ConversionFunctions.ToPen(this.C2), new Rectangle(this.T1.X, (this.T1.Y + this.T1.Height) + 2, this.T1.Width, ((base.Height - this.T1.Y) - this.T1.Height) - 4)); 622 | brush.Dispose(); 623 | StringFormat format = new StringFormat { 624 | LineAlignment = StringAlignment.Center 625 | }; 626 | graphics.DrawString(base.Text, this.Font, ConversionFunctions.ToBrush(0x71, 170, 0xba), new Rectangle(new Point(this.T1.X + 4, this.T1.Y), new Size(this.T1.Width - 40, this.T1.Height)), format); 627 | e.Graphics.DrawImage(image, 0, 0); 628 | graphics.Dispose(); 629 | image.Dispose(); 630 | } 631 | 632 | protected override void OnResize(EventArgs e) 633 | { 634 | base.OnResize(e); 635 | this.T1 = new Rectangle(1, 1, base.Width - 3, 0x12); 636 | } 637 | 638 | public SkyDarkTop Exim 639 | { 640 | get 641 | { 642 | return this.withEventsField_Exim; 643 | } 644 | set 645 | { 646 | if (this.withEventsField_Exim != null) 647 | { 648 | this.withEventsField_Exim.Click -= new EventHandler(this.Exim_Click); 649 | } 650 | this.withEventsField_Exim = value; 651 | if (this.withEventsField_Exim != null) 652 | { 653 | this.withEventsField_Exim.Click += new EventHandler(this.Exim_Click); 654 | } 655 | } 656 | } 657 | 658 | public SkyDarkTop Maxim 659 | { 660 | get 661 | { 662 | return this.withEventsField_Maxim; 663 | } 664 | set 665 | { 666 | if (this.withEventsField_Maxim != null) 667 | { 668 | this.withEventsField_Maxim.Click -= new EventHandler(this.Maxim_Click); 669 | } 670 | this.withEventsField_Maxim = value; 671 | if (this.withEventsField_Maxim != null) 672 | { 673 | this.withEventsField_Maxim.Click += new EventHandler(this.Maxim_Click); 674 | } 675 | } 676 | } 677 | } 678 | public class SkyDarkCheck : Control 679 | { 680 | private Color C1 = Color.FromArgb(0x33, 0x31, 0x2f); 681 | private Color C2 = Color.FromArgb(80, 0x4d, 0x4d); 682 | private Color C3 = Color.FromArgb(70, 0x45, 0x44); 683 | private Color C4 = Color.FromArgb(0x40, 60, 0x3b); 684 | private Color C5 = Color.Transparent; 685 | private bool chk; 686 | private MouseState ms; 687 | 688 | protected override void OnMouseDown(MouseEventArgs e) 689 | { 690 | if (base.Enabled) 691 | { 692 | this.State = MouseState.Down; 693 | } 694 | } 695 | 696 | protected override void OnMouseUp(MouseEventArgs e) 697 | { 698 | if (base.Enabled) 699 | { 700 | this.State = MouseState.None; 701 | this.Checked = !this.Checked; 702 | } 703 | } 704 | 705 | protected override void OnPaint(PaintEventArgs e) 706 | { 707 | Bitmap image = new Bitmap(base.Width - 5, base.Height - 5); 708 | Graphics graphics = Graphics.FromImage(image); 709 | graphics.Clear(base.Parent.BackColor); 710 | this.C3 = Color.FromArgb(70, 0x45, 0x44); 711 | this.C4 = Color.FromArgb(0x40, 60, 0x3b); 712 | switch (base.Enabled) 713 | { 714 | case false: 715 | this.C5 = Color.FromArgb(0x58, 0x58, 0x58); 716 | break; 717 | 718 | case true: 719 | switch (this.State) 720 | { 721 | case MouseState.None: 722 | this.C5 = Color.FromArgb(0x97, 0xb5, 190); 723 | break; 724 | 725 | case MouseState.Down: 726 | this.C5 = Color.FromArgb(0x79, 0x97, 160); 727 | this.C3 = Color.FromArgb(0x40, 60, 0x3b); 728 | this.C4 = Color.FromArgb(70, 0x45, 0x44); 729 | break; 730 | } 731 | break; 732 | } 733 | Rectangle rect = new Rectangle(0, 0, base.Height - 6, base.Height - 6); 734 | LinearGradientBrush brush = new LinearGradientBrush(new Point(rect.X, rect.Y), new Point(rect.X, rect.Y + rect.Height), this.C3, this.C4); 735 | graphics.FillRectangle(brush, rect); 736 | brush.Dispose(); 737 | graphics.DrawRectangle(ConversionFunctions.ToPen(this.C1), rect); 738 | graphics.DrawRectangle(ConversionFunctions.ToPen(this.C2), new Rectangle(rect.X + 1, rect.Y + 1, rect.Width - 2, rect.Height - 2)); 739 | Rectangle rectangle2 = new Rectangle(rect.X + (rect.Width / 4), rect.Y + (rect.Height / 4), rect.Width / 2, rect.Height / 2); 740 | Point[] pointArray = new Point[] { new Point(rectangle2.X, rectangle2.Y + (rectangle2.Height / 2)), new Point(rectangle2.X + (rectangle2.Width / 2), rectangle2.Y + rectangle2.Height), new Point(rectangle2.X + rectangle2.Width, rectangle2.Y) }; 741 | if (this.Checked) 742 | { 743 | graphics.SmoothingMode = SmoothingMode.HighQuality; 744 | Pen pen = new Pen(ConversionFunctions.ToBrush(this.C5), 2f); 745 | for (int i = 0; i <= (pointArray.Length - 2); i++) 746 | { 747 | graphics.DrawLine(pen, pointArray[i], pointArray[i + 1]); 748 | } 749 | } 750 | StringFormat format = new StringFormat { 751 | LineAlignment = StringAlignment.Center, 752 | Alignment = StringAlignment.Near 753 | }; 754 | graphics.DrawString(base.Text, this.Font, ConversionFunctions.ToBrush(this.C5), new Rectangle((rect.X + rect.Width) + 5, 0, ((base.Width - rect.X) - rect.Width) - 5, base.Height), format); 755 | e.Graphics.DrawImage(image, 0, 0); 756 | graphics.Dispose(); 757 | image.Dispose(); 758 | } 759 | 760 | public bool Checked 761 | { 762 | get 763 | { 764 | return this.chk; 765 | } 766 | set 767 | { 768 | this.chk = value; 769 | base.Invalidate(); 770 | } 771 | } 772 | 773 | public MouseState State 774 | { 775 | get 776 | { 777 | return this.ms; 778 | } 779 | set 780 | { 781 | this.ms = value; 782 | base.Invalidate(); 783 | } 784 | } 785 | 786 | public enum MouseState 787 | { 788 | None, 789 | Down 790 | } 791 | } 792 | public class SkyDarkButton : Control 793 | { 794 | private Color C1 = Color.FromArgb(0x33, 0x31, 0x2f); 795 | private Color C2 = Color.FromArgb(90, 0x5b, 90); 796 | private Color C3 = Color.FromArgb(70, 0x47, 70); 797 | private Color C4 = Color.FromArgb(0x3e, 0x3d, 0x3a); 798 | private MouseState ms; 799 | 800 | public SkyDarkButton() 801 | { 802 | this.DoubleBuffered = true; 803 | } 804 | 805 | protected override void OnMouseDown(MouseEventArgs e) 806 | { 807 | base.OnMouseDown(e); 808 | this.State = MouseState.Down; 809 | } 810 | 811 | protected override void OnMouseEnter(EventArgs e) 812 | { 813 | base.OnMouseEnter(e); 814 | this.State = MouseState.Over; 815 | } 816 | 817 | protected override void OnMouseLeave(EventArgs e) 818 | { 819 | base.OnMouseLeave(e); 820 | this.State = MouseState.None; 821 | } 822 | 823 | protected override void OnMouseUp(MouseEventArgs e) 824 | { 825 | base.OnMouseUp(e); 826 | this.State = MouseState.Over; 827 | } 828 | 829 | protected override void OnPaint(PaintEventArgs e) 830 | { 831 | Bitmap image = new Bitmap(base.Width, base.Height); 832 | Graphics graphics = Graphics.FromImage(image); 833 | LinearGradientBrush brush = new LinearGradientBrush(new Point(0, 0), new Point(0, base.Height), this.C3, this.C4); 834 | graphics.FillRectangle(brush, 0, 0, base.Width, base.Height); 835 | brush.Dispose(); 836 | if (base.Enabled) 837 | { 838 | switch (this.State) 839 | { 840 | case MouseState.Over: 841 | graphics.FillRectangle(new SolidBrush(Color.FromArgb(20, Color.White)), new Rectangle(0, 0, base.Width, base.Height)); 842 | break; 843 | 844 | case MouseState.Down: 845 | graphics.FillRectangle(new SolidBrush(Color.FromArgb(10, Color.Black)), new Rectangle(0, 0, base.Width, base.Height)); 846 | break; 847 | } 848 | } 849 | StringFormat format = new StringFormat { 850 | LineAlignment = StringAlignment.Center, 851 | Alignment = StringAlignment.Center 852 | }; 853 | switch (base.Enabled) 854 | { 855 | case false: 856 | graphics.DrawString(this.Text, this.Font, Brushes.Gray, new Rectangle(0, 0, base.Width - 1, base.Height - 1), format); 857 | break; 858 | 859 | case true: 860 | graphics.DrawString(this.Text, this.Font, ConversionFunctions.ToBrush(0x71, 170, 0xba), new Rectangle(0, 0, base.Width - 1, base.Height - 1), format); 861 | break; 862 | } 863 | format.Dispose(); 864 | graphics.DrawRectangle(ConversionFunctions.ToPen(this.C1), 0, 0, base.Width - 1, base.Height - 1); 865 | graphics.DrawRectangle(ConversionFunctions.ToPen(this.C2), 1, 1, base.Width - 3, base.Height - 3); 866 | e.Graphics.DrawImage(image, 0, 0); 867 | graphics.Dispose(); 868 | image.Dispose(); 869 | } 870 | 871 | private MouseState State 872 | { 873 | get 874 | { 875 | return this.ms; 876 | } 877 | set 878 | { 879 | this.ms = value; 880 | base.Invalidate(); 881 | } 882 | } 883 | 884 | public override string Text 885 | { 886 | get 887 | { 888 | return base.Text; 889 | } 890 | set 891 | { 892 | base.Text = value; 893 | base.Invalidate(); 894 | } 895 | } 896 | 897 | public enum MouseState 898 | { 899 | None, 900 | Over, 901 | Down 902 | } 903 | } 904 | internal static class ConversionFunctions 905 | { 906 | public static Brush ToBrush(Color Color) 907 | { 908 | return new SolidBrush(Color); 909 | } 910 | 911 | public static Brush ToBrush(Pen Pen) 912 | { 913 | return new SolidBrush(Pen.Color); 914 | } 915 | 916 | public static Brush ToBrush(int A, Color C) 917 | { 918 | return new SolidBrush(Color.FromArgb(A, C)); 919 | } 920 | 921 | public static Brush ToBrush(int R, int G, int B) 922 | { 923 | return new SolidBrush(Color.FromArgb(R, G, B)); 924 | } 925 | 926 | public static Brush ToBrush(int A, int R, int G, int B) 927 | { 928 | return new SolidBrush(Color.FromArgb(A, R, G, B)); 929 | } 930 | 931 | public static Pen ToPen(Color Color) 932 | { 933 | return new Pen(new SolidBrush(Color)); 934 | } 935 | 936 | public static Pen ToPen(SolidBrush Brush) 937 | { 938 | return new Pen(Brush); 939 | } 940 | 941 | public static Pen ToPen(int A, Color C) 942 | { 943 | return new Pen(new SolidBrush(Color.FromArgb(A, C))); 944 | } 945 | 946 | public static Pen ToPen(int R, int G, int B) 947 | { 948 | return new Pen(new SolidBrush(Color.FromArgb(R, G, B))); 949 | } 950 | 951 | public static Pen ToPen(int A, int R, int G, int B) 952 | { 953 | return new Pen(new SolidBrush(Color.FromArgb(A, R, G, B))); 954 | } 955 | } --------------------------------------------------------------------------------