谁能告诉我,我如何使用一个按钮清除RichTextBox中的内容?CheckedListBox - 选择哪个rtb将被清除?
我有一个问题与CheckedListBox - 它的工作为一个选择的位置,但不为检查标记。
private void button1_Click(object sender, EventArgs e)
{
for (int i = 0; i < checkedListBox1.Items.Count; i++)
{
if (checkedListBox1.GetItemChecked(i))
{
string str = (string)checkedListBox1.Items[i];
if(str == "rtb1")
{
richTextBox1.Clear();
richTextBox1.Focus();
}
if(str == "rtb2")
{
richTextBox2.Clear();
richTextBox2.Focus();
}
}
}