Hi,
I have a requirement to create on fontsize combo box which will display the list of all available system fontsizes using C#. If anyone know the solution, please revert back asap.
Thanks,
Tina
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Tina ThakarePosted Jul 11, 2013, 7:02 AM
Thanks for your inputs.
Thanks,
Tina
Sunny SharmaPosted Jul 11, 2013, 6:51 AM
I support the answer by Vulpes.
You can have an array of font sizes of your choice, bind the array to combo box and it's done.
VulpesPosted Jul 11, 2013, 6:34 AM
http://msdn.microsoft.com/en-us/library/system.windows.forms.fontdialog.aspx
you'll see that the sizes which are normally rendered are:
int[] fontSizes = {8, 9, 10, 11, 12, 14, 16, 18, 20, 22, 24, 26, 28, 36, 48, 72};
So binding the combobox to the above array may suffice for your requirement.