Pastebin
API
tools
faq
paste
Login
Sign up
Please fix the following errors:
New Paste
Syntax Highlighting
using System; using System.ComponentModel; using System.Drawing; using System.Drawing.Drawing2D; using System.Drawing.Text; using System.Runtime.InteropServices; using System.Windows.Forms; /*-------------------------*/ //Theme: EasyColour //Creator: Euras //Version: 1.0 //Created: 02/08/14 //Website: eurashd.com /*-------------------------*/ namespace EasyColour { class EC_Theme : ContainerControl { [DllImportAttribute("user32.dll")] public static extern int SendMessage(IntPtr hWnd, int Msg, int wParam, int lParam); [DllImportAttribute("user32.dll")] public static extern bool ReleaseCapture(); public const int WM_NCLBUTTONDOWN = 0xA1; public const int HT_CAPTION = 0x2; protected override sealed void OnHandleCreated(EventArgs e) { base.Dock = DockStyle.Fill; ForeColor = Color.White; base.OnHandleCreated(e); } private bool _IsParentForm; protected bool IsParentForm { get { return _IsParentForm; } } private bool _Transparent; public bool Transparent { get { return _Transparent; } set { _Transparent = value; if (!(IsHandleCreated)) return; SetStyle(ControlStyles.Opaque, !value); SetStyle(ControlStyles.SupportsTransparentBackColor, value); Invalidate(); } } protected override sealed void OnParentChanged(EventArgs e) { base.OnParentChanged(e); if (Parent == null) return; _IsParentForm = Parent is Form; if (_IsParentForm) { ParentForm.FormBorderStyle = _BorderStyle; } Parent.BackColor = BackColor; } private FormBorderStyle _BorderStyle; public FormBorderStyle BorderStyle { get { if (_IsParentForm) return ParentForm.FormBorderStyle; else return _BorderStyle; } set { _BorderStyle = value; if (_IsParentForm) { ParentForm.FormBorderStyle = value; } } } protected override CreateParams CreateParams { get { const int CS_DROPSHADOW = 0x20000; CreateParams cp = base.CreateParams; cp.ClassStyle |= CS_DROPSHADOW; return cp; } } protected override void OnMouseDown(MouseEventArgs e) { if (e.Button == MouseButtons.Left) { ReleaseCapture(); SendMessage(Parent.Handle, WM_NCLBUTTONDOWN, HT_CAPTION, 0); } base.OnMouseDown(e); } protected override void OnPaint(PaintEventArgs e) { base.OnPaint(e); Graphics g = e.Graphics; g.SmoothingMode = SmoothingMode.HighQuality; g.InterpolationMode = InterpolationMode.HighQualityBicubic; g.TextRenderingHint = TextRenderingHint.ClearTypeGridFit; g.FillRectangle(new SolidBrush(Color.FromArgb(75, 0, 0, 0)), new Rectangle(-1, -1, Width + 1, 25)); Image icon = Properties.Resources.icon; Size iSize = new Size(16, 16); g.DrawImage(icon, 5, 5, 16, 16); g.DrawString(Text, Font, new SolidBrush(ForeColor), new Point(25, 5), StringFormat.GenericDefault); g.Dispose(); } } class EC_Button : Control { bool isHover; string _ButtonText; Image _Image; Size _ImageSize; // Initilize Button public EC_Button() { SetStyle(ControlStyles.SupportsTransparentBackColor, true); BackColor = Color.Transparent; Cursor = Cursors.Hand; } // Mouse Hover Events protected override void OnMouseEnter(EventArgs e) { base.OnMouseEnter(e); isHover = true; Invalidate(); } protected override void OnMouseLeave(EventArgs e) { base.OnMouseLeave(e); isHover = false; Invalidate(); } // Button Text Property [Category("Appearance")] public override string Text { get { return _ButtonText; } set { _ButtonText = value; } } // Button Image Property [Category("Appearance")] public Image Image { get { return _Image; } set { _Image = value; } } // Image Size Property [Category("Appearance")] public Size ImageSize { get { return _ImageSize; } set { _ImageSize = value; } } protected override void OnPaint(PaintEventArgs e) { base.OnPaint(e); Graphics g = e.Graphics; g.InterpolationMode = InterpolationMode.HighQualityBicubic; SizeF s = g.MeasureString(_ButtonText, Font); int x = ClientSize.Width; int y = ClientSize.Height; // Top / Bottom Fills g.FillRectangle(new SolidBrush(Color.FromArgb(120, 0, 0, 0)), new Rectangle(0, y / 2, x - 1, y - 1)); g.FillRectangle(new SolidBrush(Color.FromArgb(80, 0, 0, 0)), new Rectangle(0, 0, x - 1, y / 2)); if (Text == null) { _ButtonText = Name; } // Draw Button Text g.DrawString(_ButtonText, Font, new SolidBrush(Color.White), (x - s.Width) / 2, (y - s.Height) / 2); // Apply Button Image if (_Image != null) { int imgX = _ImageSize.Width; int imgY = _ImageSize.Height; if (_ImageSize != null) { g.DrawImage(_Image, 5, (y - imgY) / 2, imgX, imgY); } else { g.DrawImage(_Image, 5, (y - imgY) / 2, 16, 16); } } // Button Hover Overlay if (isHover) { g.FillRectangle(new SolidBrush(Color.FromArgb(25, 0, 0, 0)), new Rectangle(0, 0, x, y)); } g.Dispose(); } } class EC_CheckBox : Control { bool _Checked; // Initialize Checkbox public EC_CheckBox() { SetStyle(ControlStyles.SupportsTransparentBackColor, true); BackColor = Color.Transparent; Size = new Size(20, 20); MaximumSize = Size; MinimumSize = Size; Cursor = Cursors.Hand; } // "Check" Events protected override void OnMouseClick(MouseEventArgs e) { if (_Checked) { _Checked = false; } else if (!_Checked) { _Checked = true; } Invalidate(); base.OnMouseClick(e); } public bool Checked { get { return _Checked; } set { _Checked = value; } } protected override void OnPaint(PaintEventArgs e) { base.OnPaint(e); Graphics g = e.Graphics; g.SmoothingMode = SmoothingMode.HighQuality; g.InterpolationMode = InterpolationMode.HighQualityBicubic; int x = ClientSize.Width; int y = ClientSize.Height; // Fill Outer / Inner Box g.FillEllipse(new SolidBrush(Color.FromArgb(25, 0, 0, 0)), new Rectangle(0, 0, x - 1, y - 1)); g.FillEllipse(new SolidBrush(Color.FromArgb(75, 255, 255, 255)), new Rectangle(3, 3, x - 7, y - 7)); // Apply Check Overlay if (_Checked) { g.FillEllipse(new SolidBrush(Color.FromArgb(100, 0, 0, 0)), new RectangleF(5, 5, (x / 2) - 1, (y / 2) - 1)); } g.Dispose(); } } class EC_Panel : Panel { public string _PanelText; // Text To Display On Panel [Category("Appearance")] public string PanelText { get { return _PanelText; } set { _PanelText = value; } } protected override void OnPaint(PaintEventArgs e) { base.OnPaint(e); Graphics g = e.Graphics; g.SmoothingMode = SmoothingMode.HighQuality; g.InterpolationMode = InterpolationMode.HighQualityBicubic; g.TextRenderingHint = TextRenderingHint.ClearTypeGridFit; int x = ClientSize.Width; int y = ClientSize.Height; // Top Bar Fill g.FillRectangle(new SolidBrush(Color.FromArgb(25, 0, 0, 0)), new Rectangle(0, 0, x, 25)); if (PanelText == null) { _PanelText = Name; } // Main Fill & Draw Text g.FillRectangle(new SolidBrush(Color.FromArgb(50, 0, 0, 0)), new Rectangle(0, 0, x, y)); g.DrawString(_PanelText, Font, new SolidBrush(Color.White), new Point(5, 5)); g.Dispose(); } } class EC_Tabs : TabControl { // Initialize public EC_Tabs() { DrawMode = TabDrawMode.OwnerDrawFixed; SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.DoubleBuffer | ControlStyles.ResizeRedraw | ControlStyles.UserPaint, true); DoubleBuffered = true; Dock = DockStyle.Bottom; SizeMode = TabSizeMode.Normal; ItemSize = new Size(100, 20); } // Tabs Back Color Property private Color m_Backcolor = Color.Empty; [Browsable(true)] public override Color BackColor { get { if (m_Backcolor.Equals(Color.Empty)) { if (Parent == null) return Control.DefaultBackColor; else return Parent.BackColor; } return m_Backcolor; } set { if (m_Backcolor.Equals(value)) return; m_Backcolor = value; Invalidate(); base.OnBackColorChanged(EventArgs.Empty); } } public bool ShouldSerializeBackColor() { return !m_Backcolor.Equals(Color.Empty); } public override void ResetBackColor() { m_Backcolor = Color.Empty; Invalidate(); } protected override void OnPaint(PaintEventArgs e) { base.OnPaint(e); Graphics g = e.Graphics; g.Clear(BackColor); g.SmoothingMode = SmoothingMode.HighQuality; g.InterpolationMode = InterpolationMode.HighQualityBicubic; // Apply Colouring To Each Tab Page for (int i = 0; i <= TabPages.Count - 1; i++) { Rectangle rect = GetTabRect(i); Rectangle r = new Rectangle(GetTabRect(i).X + 10, GetTabRect(i).Y + 3, 100, 20); if (SelectedTab == TabPages[i]) { g.FillRectangle(new SolidBrush(Color.FromArgb(75, 0, 0, 0)), rect); } else { g.FillRectangle(new SolidBrush(Color.FromArgb(25, 0, 0, 0)), rect); } // Draw Tab Page Text g.DrawString(TabPages[i].Text, Font, new SolidBrush(Color.White), (Rectangle)r); TabPages[i].UseVisualStyleBackColor = false; } } } class EC_Notification : UserControl { string _Text; // Initialize public EC_Notification() { SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint, true); DoubleBuffered = true; BackColor = Color.Transparent; Size = new Size(200, 25); } // Notification Property [Category("Appearance")] public string Notification { get { return _Text; } set { _Text = value; } } protected override void OnPaint(PaintEventArgs e) { base.OnPaint(e); Graphics g = e.Graphics; SizeF s = g.MeasureString(_Text, Font); g.SmoothingMode = SmoothingMode.HighQuality; g.InterpolationMode = InterpolationMode.HighQualityBicubic; int x = ClientSize.Width; int y = ClientSize.Height; // Notification Shadow g.FillRectangle(new SolidBrush(Color.FromArgb(35, Color.Black)), new Rectangle(5, 5, x, y)); // Notification Fill g.FillRectangle(new SolidBrush(Color.White), new Rectangle(0, 0, x - 5, y - 5)); // Notification Text g.DrawString(_Text, Font, new SolidBrush(Color.Black), new PointF(5, ((y - 5) - s.Height) / 2)); } } class EC_ProgressBar : Control { int max = 100; int min = 0; int val = 0; // Initialize public EC_ProgressBar() { base.Size = new Size(150, 15); SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.ResizeRedraw | ControlStyles.DoubleBuffer | ControlStyles.SupportsTransparentBackColor, true); BackColor = Color.FromArgb(25, 0, 0, 0); ForeColor = Color.FromArgb(200, 255, 255, 255); } // Progress Bar Minimum Value public int Min { get { return min; } set { if (value < 0) { min = 0; } if (value > max) { min = value; min = value; } if (value < min) { value = min; } Invalidate(); } } // Progress Bar Maximum Value public int Max { get { return max; } set { if (value < min) { min = value; } max = value; if (value > max) { value = max; } Invalidate(); } } // Progress Bar Current Value public int Value { get { return val; } set { int oldValue = val; if (value < min) { val = min; } else if (value > max) { val = max; } else { val = value; } float percent; Rectangle newValueRect = new Rectangle(ClientRectangle.X + 2, ClientRectangle.Y + 2, ClientRectangle.Width - 4, ClientRectangle.Height - 4); Rectangle oldValueRect = new Rectangle(ClientRectangle.X + 2, ClientRectangle.Y + 2, ClientRectangle.Width - 4, ClientRectangle.Height - 4); percent = (float)(val - min) / (float)(max - min); newValueRect.Width = (int)((float)newValueRect.Width * percent); percent = (float)(oldValue - min) / (float)(max - min); oldValueRect.Width = (int)((float)oldValueRect.Width * percent); Rectangle updateRect = new Rectangle(); if (newValueRect.Width > oldValueRect.Width) { updateRect.X = oldValueRect.Size.Width; updateRect.Width = newValueRect.Width - oldValueRect.Width; } else { updateRect.X = newValueRect.Size.Width; updateRect.Width = oldValueRect.Width - newValueRect.Width; } updateRect.Height = Height; Invalidate(updateRect); } } protected override void OnPaintBackground(PaintEventArgs pevent) { base.OnPaintBackground(pevent); Graphics g = pevent.Graphics; // Progress Bar Background Colour g.FillRectangle(new SolidBrush(BackColor), new Rectangle(0, 0, Width, Height)); } protected override void OnPaint(PaintEventArgs e) { base.OnPaint(e); Graphics g = e.Graphics; SolidBrush brush = new SolidBrush(ForeColor); float percent = (float)(val - min) / (float)(max - min); Rectangle rect = new Rectangle(2, 2, Width - 4, Height - 4); rect.Width = (int)((float)rect.Width * percent); // Progress Bar ForeColour g.FillRectangle(brush, rect); } } class EC_TextBox : RichTextBox { // Initialize public EC_TextBox() { BorderStyle = BorderStyle.None; Multiline = false; Size = new Size(Size.Width, 20); MaximumSize = new Size(int.MaxValue, Size.Height); MinimumSize = Size; } // PREVENT FLICKERING protected override void OnPaintBackground(PaintEventArgs pevent) { base.OnPaintBackground(pevent); } private const int WM_PAINT = 15; protected override void WndProc(ref Message m) { if (m.Msg == WM_PAINT) { Invalidate(); base.WndProc(ref m); using (Graphics g = Graphics.FromHwnd(Handle)) { g.InterpolationMode = InterpolationMode.HighQualityBicubic; } } else { base.WndProc(ref m); } } } }
Optional Paste Settings
Category:
None
Cryptocurrency
Cybersecurity
Fixit
Food
Gaming
Haiku
Help
History
Housing
Jokes
Legal
Money
Movies
Music
Pets
Photo
Science
Software
Source Code
Spirit
Sports
Travel
TV
Writing
Tags:
Syntax Highlighting:
None
Bash
C
C#
C++
CSS
HTML
JSON
Java
JavaScript
Lua
Markdown (PRO members only)
Objective C
PHP
Perl
Python
Ruby
Swift
4CS
6502 ACME Cross Assembler
6502 Kick Assembler
6502 TASM/64TASS
ABAP
AIMMS
ALGOL 68
APT Sources
ARM
ASM (NASM)
ASP
ActionScript
ActionScript 3
Ada
Apache Log
AppleScript
Arduino
Asymptote
AutoIt
Autohotkey
Avisynth
Awk
BASCOM AVR
BNF
BOO
Bash
Basic4GL
Batch
BibTeX
Blitz Basic
Blitz3D
BlitzMax
BrainFuck
C
C (WinAPI)
C Intermediate Language
C for Macs
C#
C++
C++ (WinAPI)
C++ (with Qt extensions)
C: Loadrunner
CAD DCL
CAD Lisp
CFDG
CMake
COBOL
CSS
Ceylon
ChaiScript
Chapel
Clojure
Clone C
Clone C++
CoffeeScript
ColdFusion
Cuesheet
D
DCL
DCPU-16
DCS
DIV
DOT
Dart
Delphi
Delphi Prism (Oxygene)
Diff
E
ECMAScript
EPC
Easytrieve
Eiffel
Email
Erlang
Euphoria
F#
FO Language
Falcon
Filemaker
Formula One
Fortran
FreeBasic
FreeSWITCH
GAMBAS
GDB
GDScript
Game Maker
Genero
Genie
GetText
Go
Godot GLSL
Groovy
GwBasic
HQ9 Plus
HTML
HTML 5
Haskell
Haxe
HicEst
IDL
INI file
INTERCAL
IO
ISPF Panel Definition
Icon
Inno Script
J
JCL
JSON
Java
Java 5
JavaScript
Julia
KSP (Kontakt Script)
KiXtart
Kotlin
LDIF
LLVM
LOL Code
LScript
Latex
Liberty BASIC
Linden Scripting
Lisp
Loco Basic
Logtalk
Lotus Formulas
Lotus Script
Lua
M68000 Assembler
MIX Assembler
MK-61/52
MPASM
MXML
MagikSF
Make
MapBasic
Markdown (PRO members only)
MatLab
Mercury
MetaPost
Modula 2
Modula 3
Motorola 68000 HiSoft Dev
MySQL
Nagios
NetRexx
Nginx
Nim
NullSoft Installer
OCaml
OCaml Brief
Oberon 2
Objeck Programming Langua
Objective C
Octave
Open Object Rexx
OpenBSD PACKET FILTER
OpenGL Shading
Openoffice BASIC
Oracle 11
Oracle 8
Oz
PARI/GP
PCRE
PHP
PHP Brief
PL/I
PL/SQL
POV-Ray
ParaSail
Pascal
Pawn
Per
Perl
Perl 6
Phix
Pic 16
Pike
Pixel Bender
PostScript
PostgreSQL
PowerBuilder
PowerShell
ProFTPd
Progress
Prolog
Properties
ProvideX
Puppet
PureBasic
PyCon
Python
Python for S60
QBasic
QML
R
RBScript
REBOL
REG
RPM Spec
Racket
Rails
Rexx
Robots
Roff Manpage
Ruby
Ruby Gnuplot
Rust
SAS
SCL
SPARK
SPARQL
SQF
SQL
SSH Config
Scala
Scheme
Scilab
SdlBasic
Smalltalk
Smarty
StandardML
StoneScript
SuperCollider
Swift
SystemVerilog
T-SQL
TCL
TeXgraph
Tera Term
TypeScript
TypoScript
UPC
Unicon
UnrealScript
Urbi
VB.NET
VBScript
VHDL
VIM
Vala
Vedit
VeriLog
Visual Pro Log
VisualBasic
VisualFoxPro
WHOIS
WhiteSpace
Winbatch
XBasic
XML
XPP
Xojo
Xorg Config
YAML
YARA
Z80 Assembler
ZXBasic
autoconf
jQuery
mIRC
newLISP
q/kdb+
thinBasic
Paste Expiration:
Never
Burn after read
10 Minutes
1 Hour
1 Day
1 Week
2 Weeks
1 Month
6 Months
1 Year
Paste Exposure:
Public
Unlisted
Private
Folder:
(members only)
Password
NEW
Enabled
Disabled
Burn after read
NEW
Paste Name / Title:
Create New Paste
Hello
Guest
Sign Up
or
Login
Sign in with Facebook
Sign in with Twitter
Sign in with Google
You are currently not logged in, this means you can not edit or delete anything you paste.
Sign Up
or
Login
Public Pastes
Untitled
12 hours ago | 13.15 KB
Analog GPUs: THE FUTURE
17 hours ago | 8.88 KB
Quotes I believe to be true.
17 hours ago | 0.16 KB
Die 7 wichtigsten Aktionen diese Woche
1 day ago | 4.17 KB
Untitled
1 day ago | 13.34 KB
Untitled
1 day ago | 13.59 KB
VNC SCRIPT 2/2: autoinput.vbs
VBScript | 1 day ago | 0.23 KB
VNC SCRIPT 1/2: vncauto.bat
Batch | 1 day ago | 0.72 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the
Cookies Policy
.
OK, I Understand
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!