Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Controls inheriting
Message
De
22/11/2004 18:49:42
 
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00963668
Message ID:
00963676
Vues:
8
Rodolfo,

Basically, you'll want a class library that contains your sub-classed UI controls, like textbox, button, etc. Something like this:
using System;
using System.Data;
using System.Web;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;

namespace MyCompany.WebUI.MyClasses
{
	public class MyLabel: System.Web.UI.WebControls.Label
	{
		private string m_MyProperty;

		// properties
		public string MyProperty
		{
		   get {return this.m_MyProperty;}
		   set {this.m_MyProperty = value;}
		}

	}

	public class MyTextBox : System.Web.UI.WebControls.TextBox
	{
		// code here
	}

	public class MyButton : System.Web.UI.WebControls.Button
	{
		// code here
	}
}
Add these to the ToolBox by right-clicking on the ToolBox and choosing Add/Remove Items.

~~Bonnie



>How could I create a class based on the system basic class "label", then drag and drop it on a web form, and finally be able to modify its methods and properties through the properties panel as I am used to doing with VFP.
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform