TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Arun Kurmi
NA
104
103.5k
# checkedListBox
Mar 3 2013 8:21 AM
hi friends,
Below code run but require two click on every item to check .why this ? How to resolve ?
Thanks in advance.......
private void CheckboxTextBox_Load(object sender, EventArgs e)
{
checkedListBox1.Items.Add("Bhopal");
checkedListBox1.Items.Add("Indore");
checkedListBox1.Items.Add("Banglure");
checkedListBox1.Items.Add("Mumbai");
checkedListBox1.Items.Add("Pune");
}
private void button1_Click(object sender, EventArgs e)
{
label3.Text = "Your Selected Items are :"+"\n";
for (int i = 0; i < checkedListBox1.Items.Count; i++)
{
Boolean chk;
//char chk;
chk = checkedListBox1.GetItemChecked(i);
//if(chk==true)
if (chk)
label3.Text = label3.Text + checkedListBox1.Items[i] + "\n";
}
}
Reply
Answers (
1
)
Stack
NullReferenceException was unhandled