Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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?

 

Thanks,

 

dalmond

Posted

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;

}

}

}

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...