I am trying to create a usercontrol that has five labels on it and I want to restrict the font size to no less then 8.25 and no greater then 10. Does anyone know how this can be done?
Are the labels public? Barring any cool design trick, the easiest way would be to expose the font of the control as a property and impose constraints there.
Will each label have a unique font? All the same?
public Font HeaderFont
{
get
{
return this.headerFont;
}
set
{
if (value.Size >= 8.25 && value.Size <= 10)
{
this.headerFont = value;
}
}
}
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.