Reputation: 348
When I click the button method below
private void button1_Click(object sender, EventArgs e)
{
string output;
//Concatenate the text value of the 3 text boxes
output = "Task: " + this.textBoxTask.Text + "\r\n";
output += "Description: " + this.textBoxDescription.Text + "\r\n";
output += "Due Date: " + this.textBoxDueDate.Text + "\r\n";
this.checkedListBoxTasks.Items.Add(output);
}
On the line 'Task: whatever i wrote in the textbox' is shown next to the checkbox is there anyway to make it show the other two lines?
Upvotes: 0
Views: 220
Reputation: 81
Try this one.
this.checkedListBoxTasks.Items.Add(this.textBoxTask.Text);
this.checkedListBoxTasks.Items.Add(this.textBoxDescription.Text);
this.checkedListBoxTasks.Items.Add(this.textBoxDueDate.Text);
Hope this help you. :D
Upvotes: 2
Reputation: 3274
Try to use the StringBuilder Class in the System.Text namespace for string concatening.
Upvotes: -1