I am using the in built Font dialog to choose the font size and the style. The font size range shows from 8 to 72. I need to restrict users not to choose the size beyond 20. Is it possible to disable the font size from 22 or not display them at all from 22? I don't see any property on the Font class to do this? Thanks for any suggestions.
I don't see any property on the Font class to do this?
That's because it is a property on the FontDialog class, not the Font class. For example:
using (var dlg = new FontDialog()) {
dlg.MaxSize = 20; // <=== Here
if (dlg.ShowDialog() == DialogResult.OK) {
// etc...
}
}
And you'll see that you can't possibly pick a size larger than 20.