Example. I have 12 lines in my TXT. When I Upload it into listbox. The listbox force the lines tobe 10 lines.
Anyone can teach me how to limit lines on listbox.
Any help would be greatly appreciate. Thank you~
arivbot 0 Newbie Poster
Recommended Answers
Jump to PostA listbox can hold any number of lines. If you mean that it limits the number of visible lines, you can change that by changing the Height property. If you do
ListBox1.Height = ListBox1.ItemHeight * (1 + ListBox1.Items.Count)
then, assuming the form is big enough, the …
Jump to PostUsing LINQ you can just do:
ListBox1.Items.AddRange(lines.Take(10))
You'll need:
Imports System.Linq
All 6 Replies
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster
arivbot 0 Newbie Poster
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster
Minimalist 96 Posting Pro
arivbot 0 Newbie Poster
pritaeas 2,211 ¯\_(ツ)_/¯ Moderator Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.