How to add items (text, string) to a listBox control in C#

1 Answer

0 votes
using System;
using System.Windows.Forms;

namespace workingframe
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        private void button1_Click(object sender, EventArgs e)
        {
            listBox1.Items.Add("abc");
            listBox1.Items.Add("xyz");
        }
    }
}

/*
run:

abc
xyz

*/

 



answered Mar 15, 2016 by avibootz
edited Mar 15, 2016 by avibootz

Related questions

1 answer 1,899 views
1 answer 128 views
1 answer 128 views
1 answer 116 views
1 answer 145 views
1 answer 138 views
1 answer 166 views
...