Users Pricing

forum

Home Forums how to set default value for comboBox? – MindStick

how to set default value for comboBox?

Anonymous User 2280 28 Jan 2014

Hey I am making a comboBox that is holding a list of all the fonts name on my system, however at the beginning it does not hold any value and user needs to click on it to open it and select an item from the list. my question is how to set the default value for my comboBox (for example 'Arial') in case if nothing has been selected by the user and not to give error.

        foreach (FontFamily fnt in fonts.Families)

        {

            comboBox1.Items.Add(fnt.Name);

        }


1 Answers

Markdown for AI

A clean, structured version of this page for AI assistants and LLMs.

Open .md