How to add items to ListBox 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");
        }
    }
}




/*
run:
 

  
*/

 



answered Jan 5, 2024 by avibootz

Related questions

1 answer 128 views
1 answer 145 views
1 answer 138 views
1 answer 166 views
1 answer 132 views
1 answer 154 views
1 answer 101 views
...