Click here to Skip to main content
15,893,588 members
Articles / Programming Languages / Visual Basic

Magic Library Docking Manager Designer

Rate me:
Please Sign up or sign in to vote.
3.39/5 (49 votes)
16 May 2013CPOL4 min read 445.7K   21.7K   160  
Provides docking support without writing one line of code.
using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Windows.Forms;

namespace DockingManagerExtenderDemo
{
	/// <summary>
	/// Summary description for UserControlDockingExtended.
	/// </summary>
	public class UserControlDockingExtended : System.Windows.Forms.UserControl
	{
		#region fields
		private DockingManagerExtender.DockingManagerExtender dockingManagerExtender;
		private System.Windows.Forms.PropertyGrid propertyGrid1;
		private System.Windows.Forms.Panel panel1;
		private System.ComponentModel.IContainer components;
		#endregion

		public UserControlDockingExtended()
		{
			// This call is required by the Windows.Forms Form Designer.
			InitializeComponent();

			// TODO: Add any initialization after the InitializeComponent call

		}


		#region public interface
		/// <summary>
		/// Gets the associated Docking Manager
		/// </summary>
		public DockingManagerExtender.DockingManagerExtender  DockingManager
		{
			get
			{
				return this.dockingManagerExtender;
			}
		}
		#endregion

		#region Component Designer generated code
		/// <summary> 
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		
		/// <summary> 
		/// Required method for Designer support - do not modify 
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			this.components = new System.ComponentModel.Container();
			this.dockingManagerExtender = new DockingManagerExtender.DockingManagerExtender(this.components);
			this.propertyGrid1 = new System.Windows.Forms.PropertyGrid();
			this.panel1 = new System.Windows.Forms.Panel();
			this.SuspendLayout();
			// 
			// dockingManagerExtender
			// 
			this.dockingManagerExtender.AutomaticStatePersistence = true;
			this.dockingManagerExtender.ContainerControl = this;
			this.dockingManagerExtender.InnerControl = null;
			this.dockingManagerExtender.OuterControl = null;
			this.dockingManagerExtender.PlainTabBorder = false;
			this.dockingManagerExtender.VisualStyle = Crownwood.Magic.Common.VisualStyle.IDE;
			// 
			// propertyGrid1
			// 
			this.dockingManagerExtender.SetADockingEnable(this.propertyGrid1, true);
			this.dockingManagerExtender.SetCloseButton(this.propertyGrid1, true);
			this.dockingManagerExtender.SetCloseOnHide(this.propertyGrid1, false);
			this.propertyGrid1.CommandsVisibleIfAvailable = true;
			this.dockingManagerExtender.SetDockingStyle(this.propertyGrid1, System.Windows.Forms.DockStyle.Left);
			this.dockingManagerExtender.SetFullTitle(this.propertyGrid1, "propertyGrid1");
			this.dockingManagerExtender.SetIcon(this.propertyGrid1, null);
			this.propertyGrid1.LargeButtons = false;
			this.propertyGrid1.LineColor = System.Drawing.SystemColors.ScrollBar;
			this.propertyGrid1.Location = new System.Drawing.Point(8, 8);
			this.propertyGrid1.Name = "propertyGrid1";
			this.propertyGrid1.Size = new System.Drawing.Size(80, 184);
			this.dockingManagerExtender.SetTabbedMode(this.propertyGrid1, false);
			this.propertyGrid1.TabIndex = 4;
			this.propertyGrid1.Text = "propertyGrid1";
			this.dockingManagerExtender.SetTitle(this.propertyGrid1, "propertyGrid1");
			this.propertyGrid1.ViewBackColor = System.Drawing.SystemColors.Window;
			this.propertyGrid1.ViewForeColor = System.Drawing.SystemColors.WindowText;
			// 
			// panel1
			// 
			this.dockingManagerExtender.SetADockingEnable(this.panel1, true);
			this.panel1.BackColor = System.Drawing.Color.Red;
			this.dockingManagerExtender.SetCloseButton(this.panel1, true);
			this.dockingManagerExtender.SetCloseOnHide(this.panel1, false);
			this.dockingManagerExtender.SetDockingStyle(this.panel1, System.Windows.Forms.DockStyle.Right);
			this.dockingManagerExtender.SetFullTitle(this.panel1, "panel1");
			this.dockingManagerExtender.SetIcon(this.panel1, null);
			this.panel1.Location = new System.Drawing.Point(96, 16);
			this.panel1.Name = "panel1";
			this.panel1.Size = new System.Drawing.Size(48, 72);
			this.dockingManagerExtender.SetTabbedMode(this.panel1, false);
			this.panel1.TabIndex = 5;
			this.dockingManagerExtender.SetTitle(this.panel1, "panel1");
			// 
			// UserControlDockingExtended
			// 
			this.dockingManagerExtender.SetADockingEnable(this, false);
			this.dockingManagerExtender.SetCloseButton(this, false);
			this.dockingManagerExtender.SetCloseOnHide(this, false);
			this.Controls.Add(this.panel1);
			this.Controls.Add(this.propertyGrid1);
			this.dockingManagerExtender.SetDockingStyle(this, System.Windows.Forms.DockStyle.Left);
			this.dockingManagerExtender.SetFullTitle(this, "UserControlDockingExtended");
			this.dockingManagerExtender.SetIcon(this, null);
			this.Name = "UserControlDockingExtended";
			this.Size = new System.Drawing.Size(160, 208);
			this.dockingManagerExtender.SetTabbedMode(this, true);
			this.dockingManagerExtender.SetTitle(this, "UserControlDockingExtended");
			this.ResumeLayout(false);

		}
		#endregion
	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
Switzerland Switzerland
My interest is in the future because I am going to spend the rest of my life there. (Charles Kettering)

Biography

  • 1996 - 1998 PC Board PPL, HTML, DHTML, Javascript and ASP
  • 1999 - 2001 coding Centura against Sql Database (SqlBase,MSSQL,Oracle)
  • 2002 - 2004 C# Windows Forms
  • 2005 - 2006 C# ASP.NET, Windows Forms
  • 2006 - 2009 C#, WCF, WF, WPF
  • 2010 - 2012 C#, Dynamics CRM, Sharepoint, Silverlight
  • 2013 - 2013 C#, WCF DS (OData), WF, WPF
  • 2014 - 2016 C#, Azure PaaS, Identity, OWIN, OData, Web Api
  • 2017 - now C#, aspnet.core, IdentityServer4, TypeScript & Angular @ Azure IaaS or PaaS

Interests

  • family & friends
  • chilaxing ,)
  • coding

Comments and Discussions