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();
}
}
}
How clear two RichTextBox using CheckedListBox and button
-
28-06-2023 - |
سؤال
can anybody say me, how can I clear content inside RichTextBox using one button where: CheckedListBox - select which of rtb will be cleared?
I have problem with CheckedListBox - It works for one select position, but not for checked/marked.
المحلول
لا تنتمي إلى StackOverflow