How to set ListBox font using WinForms in C#

1 Answer

0 votes
namespace WinFormsApp1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            listBox1.Items.Add("c#");
            listBox1.Items.Add("c");
            listBox1.Items.Add("c++");
            listBox1.Items.Add("java");

            listBox1.Font = new Font("Arial", 12);
        }
    }
}




/*
run:
 

  
*/

 



answered Jan 5, 2024 by avibootz

Related questions

1 answer 138 views
1 answer 123 views
1 answer 155 views
1 answer 116 views
1 answer 140 views
1 answer 146 views
...