0

下のボタンメソッドをクリックすると

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);

    }

「タスク:テキストボックスに書いたものは何でも」という行で、チェックボックスの横に表示されますが、他の2行を表示する方法はありますか?

4

2 に答える 2

2

これを試してみてください。

this.checkedListBoxTasks.Items.Add(this.textBoxTask.Text);
this.checkedListBoxTasks.Items.Add(this.textBoxDescription.Text);
this.checkedListBoxTasks.Items.Add(this.textBoxDueDate.Text);

これがお役に立てば幸いです。:D

于 2012-04-30T02:04:17.507 に答える
-1

文字列の連結にはSystem.Text 名前空間のStringBuilder クラスを使用してみてください。

于 2012-04-30T00:01:28.547 に答える