tnx for your support but don't reply only to say something.
my question is precise: I'D LIKE TO CREATE A CONTROL TAHT INHERITS
FROM A LABEL,
then: are you able to do it ? If yes, could you post me a little
example ?
Hi..
Okay here is a code sample...
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace MyCustomLabel
{
[DefaultProperty("Text")]
[ToolboxData("<{0}:WebCustomControl1 runat=server></
{0}:WebCustomControl1>")]
public class WebCustomControl1 : Label
{
[Bindable(true)]
[Category("Appearance")]
[DefaultValue("")]
[Localizable(true)]
public string Text
{
get
{
String s = (String)ViewState["Text"];
return ((s == null) ? String.Empty : s);
}
set
{
ViewState["Text"] = value;
}
}
protected override void RenderContents(HtmlTextWriter output)
{
output.Write(Text + "FromMunnacs");
}
}
}
this works... i have tested it...
here what i did...
first add a web control library from vs project templete...
then changed the
public class WebCustomControl1 : WebControl
to
public class WebCustomControl1 : Label
ofcourse i changed the rendercontent....
Thanks
Md. Masudur Rahman (Munna)
Kaz Software Ltd.
www.kaz.com.bd
http://munnacs.110mb.com