Click here to Skip to main content
15,914,943 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello friends.

I am developing one custom control. I dont want default web control property should be in my custom control.

For example

public class Ieditor : WebControl
    {.... }


When you put this control in the page, you will see default web control property such as Font,Border,Width,Height.... I want to show only those properties that I define in my class.

Thanks
Imrnakhan
Posted

I don't really understand why would you want to do this, but here's an example how to do it (for property Visible):

C#
[Browsable(false)]
public new bool Visible
{
    get { return base.Visible; }
    set { base.Visible = value; }
}
 
Share this answer
 
I dont want to write a code for all default web control property.
I think you misunderstand my requirement.
Suppose, I have three property defined in class then only three properties will be visible for control, other default web control proeprty should be hide or invisible.

Regard
Imrankhan
 
Share this answer
 
I think this is not possible, because Visual Studio shows all public properties unless you define the [Browsable(false)] attribute on them. If you want to separate your own properties from the default ones, you could group your properties with the Category attribute:
[Category("MyOwnProperties")]
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900