68 464
Assignments Done
Successfully Done
In December 2018

Answer to Question #61277 in C# for Christian

Question #61277
Hi sir/ ma'am! Regarding to Visual C#, our instructor want our program to perform the action. Using multiple checkbox and display the assigned values (if more than one checkbox is checked) of the checkbox in a single textbox. What should i do?
Expert's answer
private void checkBoxes_CheckedChanged(object sender, EventArgs e)
string values = string.Empty;
foreach (var checkBox in this.Controls.OfType<CheckBox>())
if (checkBox.Checked)
values += string.Format("{0}, ", checkBox.Text);
if (!string.IsNullOrEmpty(values))
values = values.Remove(values.Length - 2);
if (values.Split(',').Length > 1)
textBox1.Text = values;
and register all events "CheckedChanged" of checkbox using method above:
this.checkBox1.CheckedChanged += new System.EventHandler(this.checkBoxes_CheckedChanged);

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!


No comments. Be first!

Leave a comment

Ask Your question

Privacy policy Terms and Conditions