I am having some trouble when I try to load some UI. If you can download my code http://www.2shared.com/file/6531405/908ada48/Delay.html[^] and then click on the new file icon the graphics will show. I have 2 issues. firstly the panels, treview and property grids have a small but noticeable delay when they are being shown. You can see the controls incomplete as they are being drawn, it looks really messy. Is there a way to remove this delay?
Second, as you can see in the code I have a border around my UI. I dont think just drawing it is the best way to do it because when I resize the main window the refreshing causes the line to flicker. I have resulted in just turning it off when resizing. I think that it is possible to make a custom panel control and have this border drawn onto that. If so, and if it will solve the problem, can someone help me create this control.
Thanks
As requested my code is below.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using MyShapesCollection;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
panel1.Visible = false;
}
private void toolStripButtonNew_Click(object sender, EventArgs e)
{
this.SuspendLayout();
panel1.Visible = true;
Paint1();
this.ResumeLayout();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void panelMB_Paint(object sender, PaintEventArgs e)
{
int _ShadowDistance = -11;
Shapes shapes = new Shapes();
Color Main = Color.FromArgb(105, 161, 191);
Color Border = Color.FromArgb(210, 230, 250);
Color Shine = Color.White;
Color Centre = Color.White;
shapes.Draw.ShadowedBorder(panelMB, e, _ShadowDistance, Main, Shine, Centre, Border);
}
private void toolStripButtonOpen_Click(object sender, EventArgs e)
{
panel1.Visible = false;
}
private void toolStripButtonSave_Click(object sender, EventArgs e)
{
Paint1();
}
public void Paint1()
{
int _ShadowDistance = -11;
Shapes shapes = new Shapes();
Color Main = Color.FromArgb(105, 161, 191);
Color Border = Color.FromArgb(210, 230, 250);
Color Shine = Color.White;
Color Centre = Color.White;
Rectangle clipRect = new Rectangle(panelMB.Location, panelMB.Size);
Graphics g = panelMB.CreateGraphics();
PaintEventArgs a = new PaintEventArgs(g, clipRect);
shapes.Draw.ShadowedBorder(panelMB, a, _ShadowDistance, Main, Shine, Centre, Border);
}
private void Form1_Resize(object sender, EventArgs e)
{
}
private void Form1_ResizeBegin(object sender, EventArgs e)
{
panelMB.Paint-=new PaintEventHandler(panelMB_Paint);
}
private void Form1_ResizeEnd(object sender, EventArgs e)
{
panelMB.Paint += new PaintEventHandler(panelMB_Paint);
Paint1();
}
}
}
namespace WindowsFormsApplication1
{
partial class Form1
{
private System.ComponentModel.IContainer components = null;
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
private void InitializeComponent()
{
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle11 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle12 = new System.Windows.Forms.DataGridViewCellStyle();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
this.toolStripContainer1 = new System.Windows.Forms.ToolStripContainer();
this.panel1 = new System.Windows.Forms.Panel();
this.hScrollBar1 = new System.Windows.Forms.HScrollBar();
this.splitter1 = new System.Windows.Forms.Splitter();
this.panelMB = new System.Windows.Forms.Panel();
this.panelM = new System.Windows.Forms.Panel();
this.panel2 = new System.Windows.Forms.Panel();
this.panelML = new System.Windows.Forms.Panel();
this.splitter2 = new System.Windows.Forms.Splitter();
this.toolStripContainer2 = new System.Windows.Forms.ToolStripContainer();
this.treeView1 = new System.Windows.Forms.TreeView();
this.toolStrip2 = new System.Windows.Forms.ToolStrip();
this.dataGridViewData = new System.Windows.Forms.DataGridView();
this.splitter3 = new System.Windows.Forms.Splitter();
this.panelMR = new System.Windows.Forms.Panel();
this.propertyGrid1 = new System.Windows.Forms.PropertyGrid();
this.labelPropertyGrid1 = new System.Windows.Forms.Label();
this.splitterMR = new System.Windows.Forms.Splitter();
this.toolStrip3 = new System.Windows.Forms.ToolStrip();
this.toolStripButtonCategorized = new System.Windows.Forms.ToolStripButton();
this.toolStripButtonAlphabetical = new System.Windows.Forms.ToolStripButton();
this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();
this.panelMRB = new System.Windows.Forms.Panel();
this.propertyGrid2 = new System.Windows.Forms.PropertyGrid();
this.mainMenu = new System.Windows.Forms.MenuStrip();
this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.newToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator();
this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.saveAsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator6 = new System.Windows.Forms.ToolStripSeparator();
this.closeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator7 = new System.Windows.Forms.ToolStripSeparator();
this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStrip1 = new System.Windows.Forms.ToolStrip();
this.toolStripButtonNew = new System.Windows.Forms.ToolStripButton();
this.toolStripButtonOpen = new System.Windows.Forms.ToolStripButton();
this.toolStripButtonSave = new System.Windows.Forms.ToolStripButton();
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
this.toolStripSplitButtonUndo = new System.Windows.Forms.ToolStripSplitButton();
this.toolStripSplitButtonRedo = new System.Windows.Forms.ToolStripSplitButton();
this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
this.toolStripButtonCut = new System.Windows.Forms.ToolStripButton();
this.toolStripButtonCopy = new System.Windows.Forms.ToolStripButton();
this.toolStripButtonPaste = new System.Windows.Forms.ToolStripButton();
this.toolStripButtonDelete = new System.Windows.Forms.ToolStripButton();
this.RightToolStripPanel = new System.Windows.Forms.ToolStripPanel();
this.TopToolStripPanel = new System.Windows.Forms.ToolStripPanel();
this.LeftToolStripPanel = new System.Windows.Forms.ToolStripPanel();
this.BottomToolStripPanel = new System.Windows.Forms.ToolStripPanel();
this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel();
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
this.toolStripStatausLabel2 = new System.Windows.Forms.ToolStripStatusLabel();
this.toolStripProgressBar1 = new System.Windows.Forms.ToolStripProgressBar();
this.label1 = new System.Windows.Forms.Label();
this.toolStripButton1 = new System.Windows.Forms.ToolStripButton();
this.toolStripContainer1.ContentPanel.SuspendLayout();
this.toolStripContainer1.TopToolStripPanel.SuspendLayout();
this.toolStripContainer1.SuspendLayout();
this.panel1.SuspendLayout();
this.panelMB.SuspendLayout();
this.panelM.SuspendLayout();
this.panel2.SuspendLayout();
this.panelML.SuspendLayout();
this.toolStripContainer2.ContentPanel.SuspendLayout();
this.toolStripContainer2.TopToolStripPanel.SuspendLayout();
this.toolStripContainer2.SuspendLayout();
this.toolStrip2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dataGridViewData)).BeginInit();
this.panelMR.SuspendLayout();
this.toolStrip3.SuspendLayout();
this.panelMRB.SuspendLayout();
this.mainMenu.SuspendLayout();
this.toolStrip1.SuspendLayout();
this.statusStrip1.SuspendLayout();
this.SuspendLayout();
this.toolStripContainer1.ContentPanel.BackColor = System.Drawing.Color.Transparent;
this.toolStripContainer1.ContentPanel.Controls.Add(this.panel1);
this.toolStripContainer1.ContentPanel.Size = new System.Drawing.Size(1119, 623);
this.toolStripContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
this.toolStripContainer1.Location = new System.Drawing.Point(0, 0);
this.toolStripContainer1.Name = "toolStripContainer1";
this.toolStripContainer1.Size = new System.Drawing.Size(1119, 672);
this.toolStripContainer1.TabIndex = 8;
this.toolStripContainer1.Text = "toolStripContainer1";
this.toolStripContainer1.TopToolStripPanel.Controls.Add(this.mainMenu);
this.toolStripContainer1.TopToolStripPanel.Controls.Add(this.toolStrip1);
this.panel1.Controls.Add(this.hScrollBar1);
this.panel1.Controls.Add(this.splitter1);
this.panel1.Controls.Add(this.panelMB);
this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel1.Location = new System.Drawing.Point(0, 0);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(1119, 623);
this.panel1.TabIndex = 34;
this.hScrollBar1.Dock = System.Windows.Forms.DockStyle.Bottom;
this.hScrollBar1.Location = new System.Drawing.Point(0, 606);
this.hScrollBar1.Name = "hScrollBar1";
this.hScrollBar1.Size = new System.Drawing.Size(1118, 17);
this.hScrollBar1.TabIndex = 37;
this.hScrollBar1.Visible = false;
this.splitter1.BackColor = System.Drawing.SystemColors.ActiveCaptionText;
this.splitter1.Dock = System.Windows.Forms.DockStyle.Right;
this.splitter1.Location = new System.Drawing.Point(1118, 0);
this.splitter1.Name = "splitter1";
this.splitter1.Size = new System.Drawing.Size(1, 623);
this.splitter1.TabIndex = 0;
this.splitter1.TabStop = false;
this.splitter1.Visible = false;
this.panelMB.Controls.Add(this.panelM);
this.panelMB.Location = new System.Drawing.Point(30, 30);
this.panelMB.MaximumSize = new System.Drawing.Size(900, 0);
this.panelMB.MinimumSize = new System.Drawing.Size(900, 400);
this.panelMB.Name = "panelMB";
this.panelMB.Padding = new System.Windows.Forms.Padding(10);
this.panelMB.Size = new System.Drawing.Size(900, 400);
this.panelMB.TabIndex = 36;
this.panelMB.Paint += new System.Windows.Forms.PaintEventHandler(this.panelMB_Paint);
this.panelM.BackColor = System.Drawing.Color.White;
this.panelM.Controls.Add(this.panel2);
this.panelM.Dock = System.Windows.Forms.DockStyle.Fill;
this.panelM.Location = new System.Drawing.Point(10, 10);
this.panelM.Margin = new System.Windows.Forms.Padding(0);
this.panelM.Name = "panelM";
this.panelM.Size = new System.Drawing.Size(880, 380);
this.panelM.TabIndex = 31;
this.panel2.Controls.Add(this.panelML);
this.panel2.Controls.Add(this.splitter3);
this.panel2.Controls.Add(this.panelMR);
this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel2.Location = new System.Drawing.Point(0, 0);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(880, 380);
this.panel2.TabIndex = 22;
this.panelML.BackColor = System.Drawing.Color.Transparent;
this.panelML.Controls.Add(this.splitter2);
this.panelML.Controls.Add(this.toolStripContainer2);
this.panelML.Controls.Add(this.dataGridViewData);
this.panelML.Dock = System.Windows.Forms.DockStyle.Fill;
this.panelML.Location = new System.Drawing.Point(0, 0);
this.panelML.Margin = new System.Windows.Forms.Padding(0);
this.panelML.Name = "panelML";
this.panelML.Size = new System.Drawing.Size(419, 380);
this.panelML.TabIndex = 21;
this.splitter2.Dock = System.Windows.Forms.DockStyle.Right;
this.splitter2.Location = new System.Drawing.Point(270, 0);
this.splitter2.Name = "splitter2";
this.splitter2.Size = new System.Drawing.Size(3, 380);
this.splitter2.TabIndex = 30;
this.splitter2.TabStop = false;
this.splitter2.Visible = false;
this.toolStripContainer2.ContentPanel.Controls.Add(this.treeView1);
this.toolStripContainer2.ContentPanel.Size = new System.Drawing.Size(273, 355);
this.toolStripContainer2.Dock = System.Windows.Forms.DockStyle.Fill;
this.toolStripContainer2.Location = new System.Drawing.Point(0, 0);
this.toolStripContainer2.Name = "toolStripContainer2";
this.toolStripContainer2.Size = new System.Drawing.Size(273, 380);
this.toolStripContainer2.TabIndex = 2;
this.toolStripContainer2.Text = "toolStripContainer2";
this.toolStripContainer2.TopToolStripPanel.Controls.Add(this.toolStrip2);
this.treeView1.AllowDrop = true;
this.treeView1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.treeView1.Dock = System.Windows.Forms.DockStyle.Fill;
this.treeView1.Location = new System.Drawing.Point(0, 0);
this.treeView1.Margin = new System.Windows.Forms.Padding(0);
this.treeView1.Name = "treeView1";
this.treeView1.Size = new System.Drawing.Size(273, 355);
this.treeView1.TabIndex = 1;
this.toolStrip2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(240)))), ((int)(((byte)(240)))), ((int)(((byte)(240)))));
this.toolStrip2.Dock = System.Windows.Forms.DockStyle.None;
this.toolStrip2.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;
this.toolStrip2.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolStripButton1});
this.toolStrip2.LayoutStyle = System.Windows.Forms.ToolStripLayoutStyle.HorizontalStackWithOverflow;
this.toolStrip2.Location = new System.Drawing.Point(3, 0);
this.toolStrip2.Name = "toolStrip2";
this.toolStrip2.Padding = new System.Windows.Forms.Padding(6, 0, 1, 0);
this.toolStrip2.RenderMode = System.Windows.Forms.ToolStripRenderMode.System;
this.toolStrip2.Size = new System.Drawing.Size(32, 25);
this.toolStrip2.TabIndex = 1;
this.toolStrip2.Text = "toolStrip2";
this.dataGridViewData.AllowUserToAddRows = false;
this.dataGridViewData.AllowUserToDeleteRows = false;
this.dataGridViewData.AllowUserToResizeColumns = false;
this.dataGridViewData.AllowUserToResizeRows = false;
dataGridViewCellStyle9.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
this.dataGridViewData.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle9;
this.dataGridViewData.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.AllCells;
dataGridViewCellStyle10.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle10.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle10.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F);
dataGridViewCellStyle10.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle10.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle10.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle10.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.dataGridViewData.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle10;
this.dataGridViewData.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
dataGridViewCellStyle11.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle11.BackColor = System.Drawing.SystemColors.Window;
dataGridViewCellStyle11.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
dataGridViewCellStyle11.ForeColor = System.Drawing.SystemColors.ControlText;
dataGridViewCellStyle11.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle11.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle11.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.dataGridViewData.DefaultCellStyle = dataGridViewCellStyle11;
this.dataGridViewData.Dock = System.Windows.Forms.DockStyle.Right;
this.dataGridViewData.Location = new System.Drawing.Point(273, 0);
this.dataGridViewData.Name = "dataGridViewData";
this.dataGridViewData.ReadOnly = true;
dataGridViewCellStyle12.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle12.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle12.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
dataGridViewCellStyle12.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle12.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle12.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle12.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.dataGridViewData.RowHeadersDefaultCellStyle = dataGridViewCellStyle12;
this.dataGridViewData.RowHeadersVisible = false;
this.dataGridViewData.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing;
this.dataGridViewData.RowTemplate.Height = 18;
this.dataGridViewData.ScrollBars = System.Windows.Forms.ScrollBars.Horizontal;
this.dataGridViewData.Size = new System.Drawing.Size(146, 380);
this.dataGridViewData.TabIndex = 29;
this.dataGridViewData.Visible = false;
this.splitter3.Dock = System.Windows.Forms.DockStyle.Right;
this.splitter3.Location = new System.Drawing.Point(419, 0);
this.splitter3.Name = "splitter3";
this.splitter3.Size = new System.Drawing.Size(3, 380);
this.splitter3.TabIndex = 28;
this.splitter3.TabStop = false;
this.panelMR.BackColor = System.Drawing.Color.Transparent;
this.panelMR.Controls.Add(this.propertyGrid1);
this.panelMR.Controls.Add(this.labelPropertyGrid1);
this.panelMR.Controls.Add(this.splitterMR);
this.panelMR.Controls.Add(this.toolStrip3);
this.panelMR.Controls.Add(this.panelMRB);
this.panelMR.Dock = System.Windows.Forms.DockStyle.Right;
this.panelMR.Location = new System.Drawing.Point(422, 0);
this.panelMR.Margin = new System.Windows.Forms.Padding(0);
this.panelMR.Name = "panelMR";
this.panelMR.Size = new System.Drawing.Size(458, 380);
this.panelMR.TabIndex = 2;
this.propertyGrid1.AllowDrop = true;
this.propertyGrid1.CategoryForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.propertyGrid1.CommandsBackColor = System.Drawing.Color.Yellow;
this.propertyGrid1.CommandsDisabledLinkColor = System.Drawing.SystemColors.ControlText;
this.propertyGrid1.CommandsLinkColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(128)))));
this.propertyGrid1.Dock = System.Windows.Forms.DockStyle.Fill;
this.propertyGrid1.HelpVisible = false;
this.propertyGrid1.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.propertyGrid1.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(233)))), ((int)(((byte)(236)))), ((int)(((byte)(250)))));
this.propertyGrid1.Location = new System.Drawing.Point(0, 45);
this.propertyGrid1.Margin = new System.Windows.Forms.Padding(0);
this.propertyGrid1.Name = "propertyGrid1";
this.propertyGrid1.PropertySort = System.Windows.Forms.PropertySort.Categorized;
this.propertyGrid1.Size = new System.Drawing.Size(458, 159);
this.propertyGrid1.TabIndex = 17;
this.propertyGrid1.ToolbarVisible = false;
this.labelPropertyGrid1.BackColor = System.Drawing.Color.Transparent;
this.labelPropertyGrid1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.labelPropertyGrid1.Dock = System.Windows.Forms.DockStyle.Top;
this.labelPropertyGrid1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.labelPropertyGrid1.ForeColor = System.Drawing.Color.DimGray;
this.labelPropertyGrid1.Location = new System.Drawing.Point(0, 25);
this.labelPropertyGrid1.Name = "labelPropertyGrid1";
this.labelPropertyGrid1.Size = new System.Drawing.Size(458, 20);
this.labelPropertyGrid1.TabIndex = 26;
this.labelPropertyGrid1.Text = "1";
this.splitterMR.Dock = System.Windows.Forms.DockStyle.Bottom;
this.splitterMR.Location = new System.Drawing.Point(0, 204);
this.splitterMR.Name = "splitterMR";
this.splitterMR.Size = new System.Drawing.Size(458, 3);
this.splitterMR.TabIndex = 24;
this.splitterMR.TabStop = false;
this.toolStrip3.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(240)))), ((int)(((byte)(240)))), ((int)(((byte)(240)))));
this.toolStrip3.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;
this.toolStrip3.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolStripButtonCategorized,
this.toolStripButtonAlphabetical,
this.toolStripSeparator4});
this.toolStrip3.Location = new System.Drawing.Point(0, 0);
this.toolStrip3.Name = "toolStrip3";
this.toolStrip3.Padding = new System.Windows.Forms.Padding(6, 0, 1, 0);
this.toolStrip3.RenderMode = System.Windows.Forms.ToolStripRenderMode.System;
this.toolStrip3.Size = new System.Drawing.Size(458, 25);
this.toolStrip3.TabIndex = 0;
this.toolStrip3.Text = "toolStrip3";
this.toolStripButtonCategorized.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.toolStripButtonCategorized.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButtonCategorized.Image")));
this.toolStripButtonCategorized.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripButtonCategorized.Name = "toolStripButtonCategorized";
this.toolStripButtonCategorized.Size = new System.Drawing.Size(23, 22);
this.toolStripButtonCategorized.Text = "toolStripButtonCategorized";
this.toolStripButtonAlphabetical.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.toolStripButtonAlphabetical.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButtonAlphabetical.Image")));
this.toolStripButtonAlphabetical.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripButtonAlphabetical.Name = "toolStripButtonAlphabetical";
this.toolStripButtonAlphabetical.Size = new System.Drawing.Size(23, 22);
this.toolStripButtonAlphabetical.Text = "toolStripButtonAlphabetical";
this.toolStripSeparator4.Name = "toolStripSeparator4";
this.toolStripSeparator4.Size = new System.Drawing.Size(6, 25);
this.panelMRB.Controls.Add(this.propertyGrid2);
this.panelMRB.Controls.Add(this.label1);
this.panelMRB.Dock = System.Windows.Forms.DockStyle.Bottom;
this.panelMRB.Location = new System.Drawing.Point(0, 207);
this.panelMRB.Margin = new System.Windows.Forms.Padding(0);
this.panelMRB.Name = "panelMRB";
this.panelMRB.Size = new System.Drawing.Size(458, 173);
this.panelMRB.TabIndex = 27;
this.propertyGrid2.AllowDrop = true;
this.propertyGrid2.CategoryForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.propertyGrid2.CommandsBackColor = System.Drawing.Color.Yellow;
this.propertyGrid2.CommandsDisabledLinkColor = System.Drawing.SystemColors.ControlText;
this.propertyGrid2.CommandsLinkColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(128)))));
this.propertyGrid2.Dock = System.Windows.Forms.DockStyle.Fill;
this.propertyGrid2.HelpVisible = false;
this.propertyGrid2.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.propertyGrid2.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(233)))), ((int)(((byte)(236)))), ((int)(((byte)(250)))));
this.propertyGrid2.Location = new System.Drawing.Point(0, 20);
this.propertyGrid2.Margin = new System.Windows.Forms.Padding(0);
this.propertyGrid2.Name = "propertyGrid2";
this.propertyGrid2.PropertySort = System.Windows.Forms.PropertySort.Categorized;
this.propertyGrid2.Size = new System.Drawing.Size(458, 153);
this.propertyGrid2.TabIndex = 25;
this.propertyGrid2.ToolbarVisible = false;
this.mainMenu.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(227)))), ((int)(((byte)(239)))), ((int)(((byte)(255)))));
this.mainMenu.Dock = System.Windows.Forms.DockStyle.None;
this.mainMenu.GripMargin = new System.Windows.Forms.Padding(6, 2, 2, 2);
this.mainMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolStripMenuItem1});
this.mainMenu.Location = new System.Drawing.Point(0, 0);
this.mainMenu.Name = "mainMenu";
this.mainMenu.Padding = new System.Windows.Forms.Padding(0, 2, 0, 2);
this.mainMenu.Size = new System.Drawing.Size(1119, 24);
this.mainMenu.TabIndex = 0;
this.mainMenu.Text = "mainMenu";
this.toolStripMenuItem1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.newToolStripMenuItem,
this.openToolStripMenuItem,
this.toolStripSeparator5,
this.saveToolStripMenuItem,
this.saveAsToolStripMenuItem,
this.toolStripSeparator6,
this.closeToolStripMenuItem,
this.toolStripSeparator7,
this.exitToolStripMenuItem});
this.toolStripMenuItem1.Name = "toolStripMenuItem1";
this.toolStripMenuItem1.Size = new System.Drawing.Size(37, 20);
this.toolStripMenuItem1.Text = "File";
this.newToolStripMenuItem.Name = "newToolStripMenuItem";
this.newToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.newToolStripMenuItem.Text = "&New";
this.openToolStripMenuItem.Name = "openToolStripMenuItem";
this.openToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.openToolStripMenuItem.Text = "&Open";
this.toolStripSeparator5.Name = "toolStripSeparator5";
this.toolStripSeparator5.Size = new System.Drawing.Size(149, 6);
this.saveToolStripMenuItem.Name = "saveToolStripMenuItem";
this.saveToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.saveToolStripMenuItem.Text = "Save";
this.saveAsToolStripMenuItem.Name = "saveAsToolStripMenuItem";
this.saveAsToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.saveAsToolStripMenuItem.Text = "Save As";
this.toolStripSeparator6.Name = "toolStripSeparator6";
this.toolStripSeparator6.Size = new System.Drawing.Size(149, 6);
this.closeToolStripMenuItem.Name = "closeToolStripMenuItem";
this.closeToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.closeToolStripMenuItem.Text = "Close";
this.toolStripSeparator7.Name = "toolStripSeparator7";
this.toolStripSeparator7.Size = new System.Drawing.Size(149, 6);
this.exitToolStripMenuItem.Name = "exitToolStripMenuItem";
this.exitToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.exitToolStripMenuItem.Text = "E&xit";
this.toolStrip1.Dock = System.Windows.Forms.DockStyle.None;
this.toolStrip1.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;
this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolStripButtonNew,
this.toolStripButtonOpen,
this.toolStripButtonSave,
this.toolStripSeparator2,
this.toolStripSplitButtonUndo,
this.toolStripSplitButtonRedo,
this.toolStripSeparator3,
this.toolStripButtonCut,
this.toolStripButtonCopy,
this.toolStripButtonPaste,
this.toolStripButtonDelete});
this.toolStrip1.Location = new System.Drawing.Point(0, 24);
this.toolStrip1.Name = "toolStrip1";
this.toolStrip1.Padding = new System.Windows.Forms.Padding(6, 0, 1, 0);
this.toolStrip1.Size = new System.Drawing.Size(1119, 25);
this.toolStrip1.Stretch = true;
this.toolStrip1.TabIndex = 1;
this.toolStrip1.Text = "toolStrip1";
this.toolStripButtonNew.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.toolStripButtonNew.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButtonNew.Image")));
this.toolStripButtonNew.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripButtonNew.Name = "toolStripButtonNew";
this.toolStripButtonNew.Size = new System.Drawing.Size(23, 22);
this.toolStripButtonNew.Text = "toolStripButtonNew";
this.toolStripButtonNew.Click += new System.EventHandler(this.toolStripButtonNew_Click);
this.toolStripButtonOpen.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.toolStripButtonOpen.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButtonOpen.Image")));
this.toolStripButtonOpen.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripButtonOpen.Name = "toolStripButtonOpen";
this.toolStripButtonOpen.Size = new System.Drawing.Size(23, 22);
this.toolStripButtonOpen.Text = "toolStripButtonOpen";
this.toolStripButtonOpen.Click += new System.EventHandler(this.toolStripButtonOpen_Click);
this.toolStripButtonSave.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.toolStripButtonSave.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButtonSave.Image")));
this.toolStripButtonSave.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripButtonSave.Name = "toolStripButtonSave";
this.toolStripButtonSave.Size = new System.Drawing.Size(23, 22);
this.toolStripButtonSave.Text = "toolStripButtonSave";
this.toolStripButtonSave.Click += new System.EventHandler(this.toolStripButtonSave_Click);
this.toolStripSeparator2.Name = "toolStripSeparator2";
this.toolStripSeparator2.Size = new System.Drawing.Size(6, 25);
this.toolStripSplitButtonUndo.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.toolStripSplitButtonUndo.Enabled = false;
this.toolStripSplitButtonUndo.Image = ((System.Drawing.Image)(resources.GetObject("toolStripSplitButtonUndo.Image")));
this.toolStripSplitButtonUndo.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripSplitButtonUndo.Name = "toolStripSplitButtonUndo";
this.toolStripSplitButtonUndo.Size = new System.Drawing.Size(32, 22);
this.toolStripSplitButtonUndo.Text = "toolStripSplitButtonUndo";
this.toolStripSplitButtonRedo.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.toolStripSplitButtonRedo.Enabled = false;
this.toolStripSplitButtonRedo.Image = ((System.Drawing.Image)(resources.GetObject("toolStripSplitButtonRedo.Image")));
this.toolStripSplitButtonRedo.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripSplitButtonRedo.Name = "toolStripSplitButtonRedo";
this.toolStripSplitButtonRedo.Size = new System.Drawing.Size(32, 22);
this.toolStripSplitButtonRedo.Text = "toolStripSplitButtonRedo";
this.toolStripSeparator3.Name = "toolStripSeparator3";
this.toolStripSeparator3.Size = new System.Drawing.Size(6, 25);
this.toolStripButtonCut.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.toolStripButtonCut.Enabled = false;
this.toolStripButtonCut.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButtonCut.Image")));
this.toolStripButtonCut.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripButtonCut.Name = "toolStripButtonCut";
this.toolStripButtonCut.Size = new System.Drawing.Size(23, 22);
this.toolStripButtonCut.Text = "toolStripButtonCut";
this.toolStripButtonCopy.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.toolStripButtonCopy.Enabled = false;
this.toolStripButtonCopy.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButtonCopy.Image")));
this.toolStripButtonCopy.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripButtonCopy.Name = "toolStripButtonCopy";
this.toolStripButtonCopy.Size = new System.Drawing.Size(23, 22);
this.toolStripButtonCopy.Text = "toolStripButtonCopy";
this.toolStripButtonPaste.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.toolStripButtonPaste.Enabled = false;
this.toolStripButtonPaste.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButtonPaste.Image")));
this.toolStripButtonPaste.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripButtonPaste.Name = "toolStripButtonPaste";
this.toolStripButtonPaste.Size = new System.Drawing.Size(23, 22);
this.toolStripButtonPaste.Text = "toolStripButtonPaste";
this.toolStripButtonDelete.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.toolStripButtonDelete.Enabled = false;
this.toolStripButtonDelete.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButtonDelete.Image")));
this.toolStripButtonDelete.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripButtonDelete.Name = "toolStripButtonDelete";
this.toolStripButtonDelete.Size = new System.Drawing.Size(23, 22);
this.toolStripButtonDelete.Text = "toolStripButtonDelete";
this.RightToolStripPanel.Location = new System.Drawing.Point(0, 0);
this.RightToolStripPanel.Name = "RightToolStripPanel";
this.RightToolStripPanel.Orientation = System.Windows.Forms.Orientation.Horizontal;
this.RightToolStripPanel.RowMargin = new System.Windows.Forms.Padding(3, 0, 0, 0);
this.RightToolStripPanel.Size = new System.Drawing.Size(0, 0);
this.TopToolStripPanel.Location = new System.Drawing.Point(0, 0);
this.TopToolStripPanel.Name = "TopToolStripPanel";
this.TopToolStripPanel.Orientation = System.Windows.Forms.Orientation.Horizontal;
this.TopToolStripPanel.RowMargin = new System.Windows.Forms.Padding(3, 0, 0, 0);
this.TopToolStripPanel.Size = new System.Drawing.Size(0, 0);
this.LeftToolStripPanel.Location = new System.Drawing.Point(0, 0);
this.LeftToolStripPanel.Name = "LeftToolStripPanel";
this.LeftToolStripPanel.Orientation = System.Windows.Forms.Orientation.Horizontal;
this.LeftToolStripPanel.RowMargin = new System.Windows.Forms.Padding(3, 0, 0, 0);
this.LeftToolStripPanel.Size = new System.Drawing.Size(0, 0);
this.BottomToolStripPanel.Location = new System.Drawing.Point(0, 0);
this.BottomToolStripPanel.Name = "BottomToolStripPanel";
this.BottomToolStripPanel.Orientation = System.Windows.Forms.Orientation.Horizontal;
this.BottomToolStripPanel.RowMargin = new System.Windows.Forms.Padding(3, 0, 0, 0);
this.BottomToolStripPanel.Size = new System.Drawing.Size(0, 0);
this.toolStripStatusLabel1.Name = "toolStripStatusLabel1";
this.toolStripStatusLabel1.Size = new System.Drawing.Size(0, 17);
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolStripStatausLabel2,
this.toolStripProgressBar1,
this.toolStripStatusLabel1});
this.statusStrip1.LayoutStyle = System.Windows.Forms.ToolStripLayoutStyle.HorizontalStackWithOverflow;
this.statusStrip1.Location = new System.Drawing.Point(0, 672);
this.statusStrip1.Name = "statusStrip1";
this.statusStrip1.RenderMode = System.Windows.Forms.ToolStripRenderMode.ManagerRenderMode;
this.statusStrip1.Size = new System.Drawing.Size(1119, 22);
this.statusStrip1.TabIndex = 7;
this.statusStrip1.Text = "statusStrip1";
this.toolStripStatausLabel2.Name = "toolStripStatausLabel2";
this.toolStripStatausLabel2.Size = new System.Drawing.Size(33, 17);
this.toolStripStatausLabel2.Text = "Click";
this.toolStripProgressBar1.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right;
this.toolStripProgressBar1.Name = "toolStripProgressBar1";
this.toolStripProgressBar1.Size = new System.Drawing.Size(100, 16);
this.label1.BackColor = System.Drawing.Color.Transparent;
this.label1.Dock = System.Windows.Forms.DockStyle.Top;
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label1.ForeColor = System.Drawing.Color.DimGray;
this.label1.Location = new System.Drawing.Point(0, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(458, 20);
this.label1.TabIndex = 27;
this.label1.Text = "2";
this.toolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.toolStripButton1.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton1.Image")));
this.toolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripButton1.Name = "toolStripButton1";
this.toolStripButton1.Size = new System.Drawing.Size(23, 22);
this.toolStripButton1.Text = "toolStripButton1";
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1119, 694);
this.Controls.Add(this.toolStripContainer1);
this.Controls.Add(this.RightToolStripPanel);
this.Controls.Add(this.TopToolStripPanel);
this.Controls.Add(this.LeftToolStripPanel);
this.Controls.Add(this.BottomToolStripPanel);
this.Controls.Add(this.statusStrip1);
this.Name = "Form1";
this.Load += new System.EventHandler(this.Form1_Load);
this.ResizeBegin += new System.EventHandler(this.Form1_ResizeBegin);
this.Resize += new System.EventHandler(this.Form1_Resize);
this.ResizeEnd += new System.EventHandler(this.Form1_ResizeEnd);
this.toolStripContainer1.ContentPanel.ResumeLayout(false);
this.toolStripContainer1.TopToolStripPanel.ResumeLayout(false);
this.toolStripContainer1.TopToolStripPanel.PerformLayout();
this.toolStripContainer1.ResumeLayout(false);
this.toolStripContainer1.PerformLayout();
this.panel1.ResumeLayout(false);
this.panelMB.ResumeLayout(false);
this.panelM.ResumeLayout(false);
this.panel2.ResumeLayout(false);
this.panelML.ResumeLayout(false);
this.toolStripContainer2.ContentPanel.ResumeLayout(false);
this.toolStripContainer2.TopToolStripPanel.ResumeLayout(false);
this.toolStripContainer2.TopToolStripPanel.PerformLayout();
this.toolStripContainer2.ResumeLayout(false);
this.toolStripContainer2.PerformLayout();
this.toolStrip2.ResumeLayout(false);
this.toolStrip2.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.dataGridViewData)).EndInit();
this.panelMR.ResumeLayout(false);
this.panelMR.PerformLayout();
this.toolStrip3.ResumeLayout(false);
this.toolStrip3.PerformLayout();
this.panelMRB.ResumeLayout(false);
this.mainMenu.ResumeLayout(false);
this.mainMenu.PerformLayout();
this.toolStrip1.ResumeLayout(false);
this.toolStrip1.PerformLayout();
this.statusStrip1.ResumeLayout(false);
this.statusStrip1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.ToolStripContainer toolStripContainer1;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.HScrollBar hScrollBar1;
private System.Windows.Forms.Splitter splitter1;
private System.Windows.Forms.Panel panelMB;
private System.Windows.Forms.Panel panelM;
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.Panel panelML;
private System.Windows.Forms.Splitter splitter2;
private System.Windows.Forms.ToolStripContainer toolStripContainer2;
private System.Windows.Forms.TreeView treeView1;
private System.Windows.Forms.ToolStrip toolStrip2;
private System.Windows.Forms.DataGridView dataGridViewData;
private System.Windows.Forms.Splitter splitter3;
private System.Windows.Forms.Panel panelMR;
private System.Windows.Forms.PropertyGrid propertyGrid1;
private System.Windows.Forms.Label labelPropertyGrid1;
private System.Windows.Forms.Splitter splitterMR;
private System.Windows.Forms.ToolStrip toolStrip3;
private System.Windows.Forms.ToolStripButton toolStripButtonCategorized;
private System.Windows.Forms.ToolStripButton toolStripButtonAlphabetical;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator4;
private System.Windows.Forms.Panel panelMRB;
private System.Windows.Forms.PropertyGrid propertyGrid2;
private System.Windows.Forms.MenuStrip mainMenu;
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem1;
private System.Windows.Forms.ToolStripMenuItem newToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem openToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator5;
private System.Windows.Forms.ToolStripMenuItem saveToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem saveAsToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator6;
private System.Windows.Forms.ToolStripMenuItem closeToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator7;
private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem;
private System.Windows.Forms.ToolStrip toolStrip1;
private System.Windows.Forms.ToolStripButton toolStripButtonNew;
private System.Windows.Forms.ToolStripButton toolStripButtonOpen;
private System.Windows.Forms.ToolStripButton toolStripButtonSave;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
private System.Windows.Forms.ToolStripSplitButton toolStripSplitButtonUndo;
private System.Windows.Forms.ToolStripSplitButton toolStripSplitButtonRedo;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator3;
private System.Windows.Forms.ToolStripButton toolStripButtonCut;
private System.Windows.Forms.ToolStripButton toolStripButtonCopy;
private System.Windows.Forms.ToolStripButton toolStripButtonPaste;
private System.Windows.Forms.ToolStripButton toolStripButtonDelete;
private System.Windows.Forms.ToolStripPanel RightToolStripPanel;
private System.Windows.Forms.ToolStripPanel TopToolStripPanel;
private System.Windows.Forms.ToolStripPanel LeftToolStripPanel;
private System.Windows.Forms.ToolStripPanel BottomToolStripPanel;
private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel1;
private System.Windows.Forms.StatusStrip statusStrip1;
private System.Windows.Forms.ToolStripStatusLabel toolStripStatausLabel2;
private System.Windows.Forms.ToolStripProgressBar toolStripProgressBar1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.ToolStripButton toolStripButton1;
}
}
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Windows.Forms;
namespace MyShapesCollection
{
class Shapes
{
public GraphicsPath RoundedRectangle(Rectangle _Rectangle, float _Radius)
{
int X = _Rectangle.X;
int Y = _Rectangle.Y;
if (_Radius < 1)
_Radius = 1;
{
GraphicsPath _Path = new GraphicsPath();
_Path.AddLine(X + _Radius, Y, X + _Rectangle.Width - (_Radius * 2), Y);
_Path.AddArc(X + _Rectangle.Width - (_Radius * 2), Y, _Radius * 2, _Radius * 2, 270, 90);
_Path.AddLine(X + _Rectangle.Width, Y + _Radius, X + _Rectangle.Width, Y + _Rectangle.Height - (_Radius * 2));
_Path.AddArc(X + _Rectangle.Width - (_Radius * 2), Y + _Rectangle.Height - (_Radius * 2), _Radius * 2, _Radius * 2, 0, 90);
_Path.AddLine(X + _Rectangle.Width - (_Radius * 2), Y + _Rectangle.Height, X + _Radius, Y + _Rectangle.Height);
_Path.AddArc(X, Y + _Rectangle.Height - (_Radius * 2), _Radius * 2, _Radius * 2, 90, 90);
_Path.AddLine(X, Y + _Rectangle.Height - (_Radius * 2), X, Y + _Radius);
_Path.AddArc(X, Y, _Radius * 2, _Radius * 2, 180, 90);
return _Path;
}
}
public LinearGradientBrush FillRec(Control picCanvas, Color GradientColour1, Color GradientColour2)
{
{
}
LinearGradientBrush _Brush = new LinearGradientBrush(
picCanvas.ClientRectangle, GradientColour1, GradientColour2, LinearGradientMode.Vertical);
return _Brush;
}
public void Shadow(PaintEventArgs e, GraphicsPath _Path, float _ShadowDistance)
{
Matrix _Matrix = new Matrix();
_Matrix.Translate(-_ShadowDistance, -_ShadowDistance);
_Path.Transform(_Matrix);
{
PathGradientBrush _Brush = new PathGradientBrush(_Path);
_Brush.WrapMode = WrapMode.Clamp;
ColorBlend _ColorBlend = new ColorBlend(3);
_ColorBlend.Colors = new Color[]{Color.Transparent,
Color.FromArgb(180, Color.DimGray),
Color.FromArgb(180, Color.DimGray)};
_ColorBlend.Positions = new float[] { 0f, .1f, 1f };
_Brush.InterpolationColors = _ColorBlend;
e.Graphics.FillPath(_Brush, _Path);
}
Matrix _Matrix1 = new Matrix();
_Matrix1.Translate(_ShadowDistance, _ShadowDistance);
_Path.Transform(_Matrix1);
}
public Draw Draw = new Draw();
}
class Draw
{
public void FilledRect(PaintEventArgs e, Control picCanvas, float _RadiusI, Color RecColourI, Rectangle _Rectangle, float _ShadowDistance)
{
FilledRect(e, picCanvas, _RadiusI, RecColourI, _Rectangle, Color.Black, false, _ShadowDistance);
}
public void FilledRect(PaintEventArgs e, Control picCanvas, float _RadiusI, Color RecColourI, Rectangle _Rectangle, Color BorderColour, float _ShadowDistance)
{
FilledRect(e, picCanvas, _RadiusI, RecColourI, _Rectangle, BorderColour, true, _ShadowDistance);
}
private void FilledRect(PaintEventArgs e, Control picCanvas, float _Radius, Color RecColour, Rectangle _Rectangle, Color BorderColour, bool BorderBool, float _ShadowDistance)
{
Shapes shapes = new Shapes();
GraphicsPath _Path = shapes.RoundedRectangle(_Rectangle, _Radius);
LinearGradientBrush _Brush = shapes.FillRec(picCanvas, RecColour, RecColour);
if (_ShadowDistance < 0)
{
shapes.Shadow(e, _Path, _ShadowDistance);
}
e.Graphics.FillPath(_Brush, _Path);
if (BorderBool)
{
using (Pen _Pen = new Pen(BorderColour, 1f))
{
e.Graphics.DrawPath(_Pen, _Path);
}
}
}
public void ShadowedBorder(Control panelMB, PaintEventArgs e, float _ShadowDistance, Color Main, Color Shine, Color Centre, Color Border)
{
Shapes shapes = new Shapes();
float _Radius = (int)(3);
Color BorderColour = Main;
Color RecColour = Shine;
int WidthO = 2;
int WidthI = 4;
int Width = WidthO + WidthI - 1;
Padding NewPadding = new Padding(Width, Width, Width - (int)_ShadowDistance, Width - (int)_ShadowDistance);
if (panelMB.Padding != NewPadding)
{
panelMB.Padding = NewPadding;
}
Rectangle _Rectangle = new Rectangle((int)(0), (int)(0),
(int)(panelMB.Width + (_ShadowDistance)), (int)(panelMB.Height + (_ShadowDistance)));
shapes.Draw.FilledRect(e, panelMB, _Radius, RecColour, _Rectangle, BorderColour, _ShadowDistance);
float _RadiusO = (int)(0);
Rectangle _RectangleO = new Rectangle((int)(_Rectangle.X) + WidthO, (int)(_Rectangle.Y) + WidthO,
(int)(_Rectangle.Width) - WidthO * 2 + 1, (int)(_Rectangle.Height) - WidthO * 2 + 1);
Color RecColourO = Border;
shapes.Draw.FilledRect(e, panelMB, _RadiusO, RecColourO, _RectangleO, 0);
float _RadiusI = (int)(0);
Color RecColourI = Centre;
Rectangle _RectangleI = new Rectangle((int)(_Rectangle.X) + WidthI, (int)(_Rectangle.Y) + WidthI,
(int)(_Rectangle.Width) - WidthI * 2, (int)(_Rectangle.Height) - WidthI * 2);
shapes.Draw.FilledRect(e, panelMB, _RadiusI, RecColourI, _RectangleI, BorderColour, 0);
}
}
}
modified on Thursday, July 2, 2009 7:14 AM
|