views:

166

answers:

1

I have been designing controls in Visual Studio 2008 and as you may have notice when I use radio button and checkbox web controls for ASP .NET it shows the name on design view, this causes me to see an odd preview because the text are unnecessarily wide. I was wondering if there is any settings in visual studio to turn this off?

+1  A: 

Hi

I don't think there is a setting in Visual Studio. But here a Solution how you can do it:

Inherit from CheckBox and assign a new Designer.

Here a very basic exsample (tested and it works):

public class MyCheckBoxDesigner : CheckBoxDesigner
{
    public override string GetDesignTimeHtml()
    {
        return "<input type=checkbox />";
    }

}

[Designer(typeof(MyCheckBoxDesigner))]
public class MyCheckBox : CheckBox
{

}
gsharp
I was wondering, how can i drag an inherited checkbox in the designer?
Nassign
If its not appears in the Toolbox by itself, then right click the Toolbox and select "Choose Items..." and browse for your assembly.
gsharp