Click here to Skip to main content
13,139,515 members (49,540 online)
Click here to Skip to main content

Stats

28.5K views
521 downloads
7 bookmarked
Posted 26 Aug 2012

Resolve DesignMode for a User Control

, 26 Aug 2012
The tip shows one way to resolve if a user control is in design mode.
´╗┐namespace Controls {
	partial class TestControl {
		/// <summary> 
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.IContainer components = null;

		/// <summary> 
		/// Clean up any resources being used.
		/// </summary>
		/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
		protected override void Dispose(bool disposing) {
			if (disposing && (components != null)) {
				components.Dispose();
			}
			base.Dispose(disposing);
		}

		#region Component Designer generated code

		/// <summary> 
		/// Required method for Designer support - do not modify 
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent() {
			this.txtText = new System.Windows.Forms.TextBox();
			this.SuspendLayout();
			// 
			// txtText
			// 
			this.txtText.Dock = System.Windows.Forms.DockStyle.Fill;
			this.txtText.Location = new System.Drawing.Point(0, 0);
			this.txtText.Multiline = true;
			this.txtText.Name = "txtText";
			this.txtText.Size = new System.Drawing.Size(150, 150);
			this.txtText.TabIndex = 0;
			// 
			// TestControl
			// 
			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			this.Controls.Add(this.txtText);
			this.Name = "TestControl";
			this.Load += new System.EventHandler(this.TestControl_Load);
			this.ResumeLayout(false);
			this.PerformLayout();

		}

		#endregion

		private System.Windows.Forms.TextBox txtText;
	}
}

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)

Share

About the Author

Wendelius
Architect
Finland Finland
No Biography provided

You may also be interested in...

Pro
Pro
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.170915.1 | Last Updated 26 Aug 2012
Article Copyright 2012 by Wendelius
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid