How to set ListBox location 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.Location = new System.Drawing.Point(25, 40);
        }
    }
}




/*
run:
 

  
*/

 



answered Jan 5, 2024 by avibootz

Related questions

1 answer 231 views
1 answer 234 views
1 answer 250 views
1 answer 247 views
1 answer 252 views
1 answer 265 views
...