The error has no relation with combobox.
the error message clearly says the
emSize
that is second param to the font constructor should be from 0 to System.Single.MaxValue
so put a check for
cmbSize.SelectedItem
before line
richtextbox1.SelectionFont=newFont(fontComboBox1.Text,Convert.ToInt32(cmbSize.SelectedItem));.
var FontSize = Convert.ToInt32(cmbSize.SelectedItem);
if (0 < FontSize && FontSize < System.Single.MaxValue )
{
richtextbox1.SelectionFont=newFont(fontComboBox1.Text,Convert.ToInt32(cmbSize.SelectedItem));.
}
else
{
}