In my program i took a listbox, in this listbox I added number of items.
Now I want to know how to get number of listbox items & show number of items in a textbox. when number of items is not fixed.
Let's say your listbox is called ListBox1 and textbox is TextBox1. Then the code you need is
TextBox1.Text = ListBox1.Items.Count.ToString();
Of course knowing your platform (WinForms, WebForms, Html etc.) would help a lot for a more accurate answer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With