Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
Adding Items to a ListBox
WhatsApp
Mahesh Chand
6y
75.5k
0
1
100
Article
Ok, adding items to a listbox control is easy. You use Add method of the control. The following code shows you how to do so.
Drag a ListBox control on a form and use the following code to add items to the control.
Source Code
private
void
Form1_Load(
object
sender, System.EventArgs e)
{
string
str =
"First item"
;
int
i = 23;
float
flt = 34.98f;
listBox1.Items.Add(str);
listBox1.Items.Add(i.ToString());
listBox1.Items.Add(flt.ToString());
listBox1.Items.Add(
"Last Item in the List Box"
);
}
Next >>
ListBox in C#
.NET
C#
listbox control
Windows Application
Windows Forms
Up Next
Ebook Download
View all
Raspberry Pi -Sensorial Symphony of Connectivity
Read by 693 people
Download Now!
Learn
View all
Mindcracker
Founded in 2003, Mindcracker is the authority in custom software development and innovation. We put best practices into action. We deliver solutions based on consumer and industry analysis.
Membership not found