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?
Asked
Active
Viewed 589 times
1
-
I just found a solution for this. In your Checkbox or Radio Button tag, set the Text attribute to a single character space and the problem is solved. – Nap Sep 16 '09 at 02:27
1 Answers
1
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
- 27,557
- 22
- 88
- 134
-
-
1If its not appears in the Toolbox by itself, then right click the Toolbox and select "Choose Items..." and browse for your assembly. – gsharp Sep 03 '09 at 11:25